Python Library to manage FreeBSD jails with libiocage.
iocage is a jail/container manager amalgamating some of the best features and technologies the FreeBSD operating system has to offer. It is geared for ease of use with a simple and easy to understand command syntax.
This library provides programmatic access to iocage features and jails, while being compatible with iocage-legacy, and the current Python 3 version of iocage.
pkg install python36 py36-pygit2 py36-libzfs libucl
python3.6 -m ensurepip
pip3.6 install iocage
git clone https://github.com/iocage/libiocage
cd libiocage
make install
Please note: this will build py-libzfs
from source, which will require /usr/src
to be populated.
import iocage
jail = iocage.Jail()
jail.create("11.1-RELEASE")
Libiocage comes bundles with a CLI tool called ioc
. It is inspired by the command line interface of iocage but meant to be developed along with the library and to spike on new features.
zfs create zroot/iocage/releases/custom/root
cd /usr/src
#install your source tree
make installworld DESTDIR=/iocage/releases/custom/root
make distribution DESTDIR=/iocage/releases/custom/root
ioc fetch -r custom -b
make installworld DESTDIR=/iocage/releases/custom/root
ioc fetch -r custom -b
make install-dev
Unit tests may run on FreeBSD or HardenedBSD and require an activated iocage pool.
pytest
At this time differential type checking is enabled, which allows us to incrementally cover the library with strong typings until we can switch to strict type checking.
setenv MYPYPATH `pwd`/.travis/mypy-stubs
mypy iocage/
The code style is automatically checked with flake8.