Setting up an isolated container based on a Docker image filesystem (which is by default [busybox](https://hub.docker.com/_/busybox)
) is the goal of the work.
The article Linux containers in a few lines of code served as the foundation for the container source code.
- Filesystem, processes and network interfaces isolated from the host system.
- The filesystem is persistent and stored as
.img
file (ext4)
sudo make rootfs
sudo make compile
sudo make run
Use the sudo
for every make
command.
Makefile
is configured to create rootfs.img
file from busybox
image, change if needed.
-
make rootfs
Create new
rootfs.img
file. This file has to exist for the container to run. -
make compile
Compile the container source, creating
./container
file -
make run
This runs two actions one after another:
-
make shell
Runs
/bin/sh
in the container. -
make restore
Restore
procfs
, removerootfs.img
mount and loop.
-