/coal

Linux container creating tool like docker for learning purposes

Primary LanguageRustApache License 2.0Apache-2.0

coal

Linux container like docker for learning purposes

Setup

  1. If you don't have rust installed, follow the instructions here.

  2. Clone and build the repository

git clone https://github.com/deep110/coal.git
cd coal && cargo build
  1. 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

Running the container

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.

Implemented [As shown in demo]

  • 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

Reading Material / libc functions used

TODO

  1. Making an exec command like docker.
  2. Mounting additional volumes and folders.