Linux container like docker for learning purposes
-
If you don't have rust installed, follow the instructions here.
-
Clone and build the repository
git clone https://github.com/deep110/coal.git
cd coal && cargo build
- Download alpine file system and unzip into folder named alpine. We will use this as a base image.
wget http://dl-cdn.alpinelinux.org/alpine/v3.9/releases/x86_64/alpine-minirootfs-3.9.4-x86_64.tar.gz
mkdir alpine && tar -xzf alpine-minirootfs-3.9.4-x86_64.tar.gz -C alpine
If you are running from debug build:
sudo target/debug/coal run /bin/sh
In place of bash you can run any command that will be available in alpine by default.
- A new process is started in run command
- Container has its own PID tree, host and network
- Limit on number of process using control groups
- Making an
exec
command like docker. - Mounting additional volumes and folders.