这是indexloc提供的服务,不要输入任何密码
Skip to content
/ navio Public
forked from viniciusbds/navio

Navio is a program to create and manage linux containers. This project exists only for study purposes, so feel free to contribute :)

License

Notifications You must be signed in to change notification settings

u5surf/navio

Repository files navigation

godocs

Navio

drawing


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.

Why?

Just for science, do not use this code in production !!! :D.

Available Images

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

Requirements

  • golang environment
  • make
  • wget
  • some of commands (ex.: navio build, navio run, navio rmi and navio exec) must be executed with sudo privilegies.

How to install

If you just want use, is very simples:

 git clone https://github.com/viniciusbds/navio.git
 cd navio
 sudo cp ./navio /usr/local/bin

If you want compile the code before running it:

 git clone https://github.com/viniciusbds/navio.git
 cd navio
 make
 sudo cp ./navio /usr/local/bin

To run all unit tests, type:

 sudo su -
 cd /path/to/project/navio
 make unit-tests

To uninstall:

sudo rm /usr/local/bin/navio

Example Commands

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

Contributing

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

References

About

Navio is a program to create and manage linux containers. This project exists only for study purposes, so feel free to contribute :)

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 96.2%
  • Shell 3.5%
  • Makefile 0.3%