sadaszewski bc5ffb6349 | 4 vuotta sitten | |
---|---|---|
example | 4 vuotta sitten | |
focker | 4 vuotta sitten | |
scripts | 4 vuotta sitten | |
.gitignore | 4 vuotta sitten | |
README.md | 4 vuotta sitten | |
requirements.txt | 4 vuotta sitten | |
setup.py | 4 vuotta sitten |
Focker is a FreeBSD image orchestration tool in the vein of Docker.
In order to use Focker you need a ZFS pool available in your FreeBSD installation.
Run:
git clone https://github.com/sadaszewski/focker.git
cd focker/
python setup.py install
or (if you want an uninstaller):
git clone https://github.com/sadaszewski/focker.git
cd focker/
python setup.py sdist
pip install dist/focker-0.9.tgz
Upon first execution of the focker
command, Focker will automatically create the necessary directories and ZFS datasets. You just need to exclude the unlikely case that you are already using /focker in your filesystem hierarchy. The layout after initialization will look the following:
/focker
/focker/images
/focker/jails
/focker/volumes
images
, jails
, and volumes
have corresponding ZFS datasets with canmount=off
so that they serve as mountpoint anchors for child entries.
To bootstrap the images system you need to install FreeBSD in jail mode to a ZFS dataset placed in /focker/images and provide two user-defined properties - focker:sha256
and focker:tags
. One way to achieve this would be the following:
TAGS="freebsd-latest freebsd-$(freebsd-version | cut -d'-' -f1)"
VERSION="FreeBSD $(freebsd-version)"
SHA256=$(echo -n ${VERSION} | sha256)
NAME=${SHA256:0:7}
zfs create -o focker:sha256=${SHA256} -o focker:tags="${TAGS}" zroot/focker/images/${NAME}
bsdinstall jail /focker/images/${NAME}
zfs set readonly=on zroot/focker/images/${NAME}
zfs snapshot zroot/focker/images/${NAME}@1