I’ve been using the new python rewrite of the jail manager iocage for FreeBSD, and since it’s still in rapid development there have been a lot of new changes and bug fixes. A few of which have been fixes to issues I experienced myself. Since releases aren’t put out with every update I decided it would be a good idea to run from the master branch.

Since I didn’t feel like polluting my system with user installed python packages that weren’t being managed by the package manager, I thought it would be a good idea to install them into a virtual environment. It seems to have worked well so far.

Requirements and Setup Link to heading

Update your current packages and install the requirements. If you already have git on your system you don’t need to install git-lite.

pkg update && pkg upgrade && pkg install python36 libgit2 git # Or git-lite

Create and enter/usr/local/opt/iocage, or whichever directory you are going to install into and clone the source.

mkdir -p /usr/local/opt/iocage
cd /usr/local/opt/iocage
git clone --recursive https://github.com/iocage/iocage

Enter source directory, create a venv for the install..

cd iocage
python3.6 -m venv venv

Install Link to heading

With everything set up, enter the venv and install. When inside the virtualenv, the python packages listed in the Makefile, that are installed during make install will be installed into our virtualenv /usr/local/opt/iocage/iocage/venv/. After running deactivate, any python commands will no longer be run in the virtual environment.

source venv/bin/activate
make install
deactivate

Symlink the script to /usr/local/bin/ so that the rc.d scripts look for it in the right place, and so that it shows up in the PATH variable.

ln -s /usr/local/opt/iocage/iocage/venv/bin/iocage /usr/local/bin/iocage

Now it should be able to be used from anywhere.

iocage --version
Version 0.9.9.2 RC

To update to the latest code, reenter the virtual environment and run make install again.