Docker on FreeBSD
If you’re thinking of playing around with this Docker thing, I invite you to try it out on FreeBSD. Please note, this is experimental and probably shouldn’t be attempted under any circumstances.
So why Docker? Why not just good old jails? I can run Ubuntu on my FreeBSD gear with Docker. You can’t do that with jails.
Step 0, if you will, is to get onto a development branch of FreeBSD. You need to run HEAD to get the Linux 64-bit compatibility. How to do this is in the handbook.
After you get on a development branch, install the
# pkg install docker-freebsd
Docker currently relies on ZFS, so you’ll want to create a file system for that:
# zfs create -o mountpoint=/usr/docker zroot/docker
docker service to start at boot:
# sysrc docker_enable="YES"
docker-freebsd package instructs you to set a PF rule, which I add to my
pf.conf. As long as you NAT traffic to Docker, it doesn’t matter what firewall you’re using.
Fetching an image
Fetching an image is pretty straightforward if you’re used to Docker.
# docker pull ubuntu:latest
# docker run -t -i ubuntu /bin/bash root@:/# uname -a Linux 2.6.32 FreeBSD 11.0-CURRENT #0 168f374(master): Mon Oct 26 01:16:47 EDT x86_64 x86_64 x86_64 GNU/Linux
Bam! Ubuntu on FreeBSD.