A lightweight implementation of Docker-style filesystem and process isolation, along with handling for registry images. It shows core Docker functionalities for educational purposes or lightweight use cases
This project mimics essential Docker functionalities, including filesystem isolation, process isolation, and registry image management. It's designed to help users understand how Docker works under the hood and to provide a lightweight alternative for specific use cases
- Filesystem Isolation: Implements isolated filesystems using
chroot
for containers - Process Isolation: Ensures processes run in separate namespaces using
unshare
- Registry Image Handling: Supports pulling and storing images from a registry
Before you begin, ensure you have the following:
- Docker installed. Follow the instructions on the Docker website to install Docker
- A Linux environment or Windows with WSL2 for running the scripts.
- I recommend using Docker (i know, trippy) in order to run in MacOS or Windows using the
rs-docker.sh
script. Currently working on a better way
- I recommend using Docker (i know, trippy) in order to run in MacOS or Windows using the
-
Clone the repository:
git clone https://github.com/dpouris/rs-docker cd rs-docker
-
Ensure the scripts have Unix-style line endings. If you cloned the repo on Windows, run:
sed -i -e 's/\r$//' /app/rs-docker.sh
Currently the only supported command is run
but in the future I plan to implement most, if not all, of Dockers main commands and some more helper commands.
- run:
rs-docker run <image> <command> <arg1> <arg2> ...
Run the provided script:
chmod +x ./rs-docker.sh
./rs-docker.sh run ubuntu:latest echo "hello world"
-
Build
src
cargo build --release
-
Run the program using the supported commands:
./target/release/rs-docker run ubuntu:latest echo "hello world"