3.1 KiB
Docker on FreeBSD
The FreeBSD port of Docker requires ZFS and FreeBSD 11.1-RELEASE or greater.
Participate
Chat for this effort can be found in the #freebsd-docker
chanenl on
Freenode.
Running
Prerequisites
Please ensure the following packages are installed:
-
go
-
git
-
sqlite3
-
bash
-
ca_root_nss
sudo pkg install ca_root_nss bash sqlite3 git go
Setting up ZFS
-
Load the kernel module:
kldload zfs
-
sudo zfs mount -a
Setting up networking
Docker provides each container an unique ip address on shared network interface
docker run -it lexaguskov/freebsd ifconfig lo1
Docker configures basic networking for the container itself, but in order to route traffic in/out of the container, some manual Pf configuration is required.
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
Progress
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 |
✅ |
Hacking
To build on 11.1-RELEASE, assuming the Prerequisites have been installed:
AUTO_GOPATH=1 ./hack/make.sh binary
This should create the docker
executable in ./bundles/latest/binary
.
Please ensure that ZFS and Networking are set up properly.
Misc. Notes
Running the 1.7.0 version of the daemon in debug mode:
sudo docker -d -e jail -s zfs -g /usr/docker -D
Running the 1.8.0 version of the daemon in debug mode:
sudo ./bundles/latest/binary/docker daemon -D -e jail -s zfs -g /usr/docker