Build Status

Synopsis

The zoostrap utility is a simple tool for bootstrapping a Linux host distribution and running command in an unprivileged container.

Actually this tool proceeds in three steps:

The list of available x86_64 distributions is currently:

Some x86 distributions are also available with the ZS_DISTRIB_ARCH=i686 parameter:

This tool is still a prototype and as of now configuration is passed through the environment, refer to the TODO file for next steps.

Note that this tool requires a kernel >= 3.11.x in order to execute unprivileged containers. In particular if you have this kind of error: ERROR: unshare failed with error Invalid argument. The host distribution kernel is probably too old.

The tool uses 3 companions tools as backend:

See references section.

Download

Download a specific release from the release page: https://github.com/guillon/zoostrap/releases

Or download the last stable version from there: https://raw.githubusercontent.com/guillon/zoostrap/master/zoostrap

For instance:

$ wget -O ~/bin/zoostrap https://raw.githubusercontent.com/guillon/zoostrap/master/zoostrap
$ chmod +x ~/bin/zoostrap

The first command gets the zoostrap tool and the second command sets execution bit.

Examples

A typical usage is to bootstrap for instance a CentOS or Ubuntu distribution and then execute a build command into the installed distribution root tree.

For instance, assuming zoostrap is available in the path:

$ env ZS_DISTRIB_ID=ubuntu ZS_DISTRIB_RELEASE=12.04 \
  ZS_DISTRIB_PACKAGES="wget" \
  zoostrap rootfs
$ rootfs/.zoostrap/run wget https://raw.githubusercontent.com/guillon/zoostrap/master/zoostrap
...

The first command installs a Ubuntu 12.04 core root tree in the rootfs/ directory and install the wget package.

The second command executes a wget command in the just installed distro.

One can also do this with a single command, passing the command to execute as parameter:

$ env ZS_DISTRIB_ID=ubuntu ZS_DISTRIB_RELEASE=12.04 \
  ZS_DISTRIB_PACKAGES="wget" \
  zoostrap rootfs wget https://raw.githubusercontent.com/guillon/zoostrap/master/zoostrap
... # Parameters

zoostrap gets parameters from the environment except for the rootfs directory to create which is passed as argument.

The available parameters are:

Build and Install

This script requires bash and wget packages and should work on any Linux distribution for x86_64 architecture with a kernel >= 3.0.

The script can be used directly without installation.

A makefile is provided for completion and testing purpose.

Build with:

$ make all # a no-op actually

Run unit tests with:

$ make check

Install with, for instance:

$ make install PREFIX=$HOME/local  # Default is PREFIX=/usr/local

References

Refer to the project home page at: http://guillon.github.com/zoostrap

Refer to the current build and validation status at: https://travis-ci.org/guillon/zoostrap?branches

Fill issues and enhancement request at: https://github.com/guillon/zoostrap/issues

Refer to the TODO file for future work: https://github.com/guillon/zoostrap/blob/master/TODO

Refer to ckains at: https://github.com/mickael-guene/ckains

Refer to PRoot at: http://proot.me

Refer to bcache at: https://guillon.github.com/bcache/

License

Refer to the COPYING file: https://github.com/guillon/zoostrap/blob/master/COPYING Refer to the COPYRIGHT file: https://github.com/guillon/zoostrap/blob/master/COPYRIGHT