Navio is a simple tool to create linux containers based on the namespace and cgroups features.
The Navio creates containers, that is, a set of processes isolated by Linux namespaces, for example: PID to isolate the processes and Mount to isolate the file systems.
All created containers have their own rootfs (a mini operating system) associated, so that a change (for example, an installation of any library) in a container does not affect others ones.
It is also possible to limit the amount of resources that each container can use, this is done through Cgroups.
Just for science, do not use this code in production !!! :D.
| Image | version | size |
|---|---|---|
| alpine | v3.11 | 2.7M |
| busybox | v4.0 | 1.5M |
| ubuntu | v20.04 | 90M |
what the processes can see
CLONE_NEWUTS : The UTS namespace provides isolation of the hostname and domainname system identifiers
CLONE_NEWPID : PID namespace isolates the process ID number space. This means that two processes running on the same host can have the same PID!
CLONE_NEWNS : The Mount namespace isolate the filesystem mount points
-
UTS - isolate hostname and domainname
-
PID - isolate the PID number space
-
MNT - isolate filesystem mount points
-
IPC - isolate interprocess communication (IPC) resources
-
NET - isolate network interfaces
-
User - isolate UID/GID number spaces
-
Cgroup - isolate cgroup root directory
-
Time Namespace - allows processes to see different system times in a way similar to the UTS namespace.
what the processes can use
-
Memory
-
CPU
-
I/O
-
Process numbers
- golang environment
- make
- wget
- some of commands (ex.:
navio build,navio run,navio rmiandnavio exec) must be executed with sudo privilegies.
git clone https://github.com/viniciusbds/navio.git
cd navio
sudo cp ./navio /usr/local/bin
git clone https://github.com/viniciusbds/navio.git
cd navio
make
sudo cp ./navio /usr/local/bin
sudo su -
cd /path/to/project/navio
make unit-tests
sudo rm /usr/local/bin/navio
navio get images
sudo navio rmi alpine
navio pull alpine
sudo navio run alpine sh --name mycontainer
sudo navio exec mycontainer sh
...
sudo navio run busybox sh
sudo navio run ubuntu /bin/bash --name python3apps
You can contribute to the project in any way you want, either by fixing bugs, implementing new features, improving the documentation or proposing new features through issues
See Contributting for more details