The FreeBSD port of Docker requires ZFS and FreeBSD 11.1-RELEASE or greater.
Note
|
The current |
Chat for this effort can be found in the #freebsd-docker
chanenl on
Freenode.
Please ensure the following packages are installed in order to build from source:
-
go
-
git
-
bash
-
ca_root_nss
-
libepoll-shim
sudo pkg install ca_root_nss bash git go libepoll-shim
In order to provide storage for containers running on FreeBSD, Docker relies on ZFS underneath the hood. This means the FreeBSD system must have ZFS loaded, and active.
kldload zfs && \
dd if=/dev/zero of=/usr/local/dockerfs bs=1024K count=4000 && \
zpool create -f zroot /usr/local/dockerfs && \
zfs create -o mountpoint=/usr/docker zroot/docker
In order to provide networking for containers, Docker must have access to
Packet Filter (pf
).
-
sudo kldload pf
The example below provides a bridged network for Docker. If you installed
FreeBSD/Docker via the sysutils/docker-freebsd
port, this will already be
configured for you.
echo "nat on {yout-external-interface} from 172.17.0.0/16 to any -> ({your-external-interface})" > /etc/pf.conf
pfctl -f /etc/pf.conf
pfctl -e
Feature | Status |
---|---|
Image loading |
✅ |
Container creationg |
✅ |
Container start/stop |
✅ |
Shared Networking |
partial support |
Port forwarding |
✅ |
Volumes |
❌ |
Links |
❌ |
Virtual networking |
❌ |
Limits |
❌ |
Command | Status |
---|---|
attach |
✅ |
build |
|
commit |
✅ |
cp |
✅ |
create |
✅ |
diff |
✅ |
events |
✅ |
exec |
✅ |
export |
✅ |
history |
✅ |
images |
✅ |
import |
✅ |
info |
🐛 |
inspect |
✅ |
kill |
✅ |
load |
🐛 |
login |
✅ |
logout |
✅ |
logs |
✅ |
pause |
❌ |
port |
✅ |
ps |
✅ |
pull |
✅ |
push |
✅ |
rename |
✅ |
restart |
✅ |
rm |
✅ |
rmi |
✅ |
run |
✅ |
save |
✅ |
search |
✅ |
start |
✅ |
stats |
🐛 |
stop |
✅ |
tag |
✅ |
top |
✅ |
unpause |
❌ |
version |
✅ |
wait |
✅ |
To build on 11.1-RELEASE, assuming the Prerequisites have been installed:
gmake -f Makefile.freebsd
This should create the docker
and dockerd
executables in
./bundles/latest/
. Please ensure that ZFS and Networking are set up properly.
Below are a list of useful references for understanding both Docker and Docker/FreeBSD.