Skip to content

Latest commit

 

History

History
265 lines (177 loc) · 3.66 KB

FreeBSD.adoc

File metadata and controls

265 lines (177 loc) · 3.66 KB

Docker on FreeBSD

The FreeBSD port of Docker requires ZFS and FreeBSD 11.1-RELEASE or greater.

Note

The current freebsd-compat branch is based off of the v17.05.0-ce tag from upstream.

Participate

Chat for this effort can be found in the #freebsd-docker chanenl on Freenode.

Running

Prerequisites

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

Setting up ZFS

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.

Systems without ZFS-based disks

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

Systems with ZFS-based disks

zfs create -o mountpoint=/usr/docker zroot/docker

Setting up networking

Setting up Packet Filer

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

Progress

Table 1. Features
Feature Status

Image loading

Container creationg

Container start/stop

Shared Networking

partial support

Port forwarding

Volumes

Links

Virtual networking

Limits

Table 2. Commands
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:

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.

References

Below are a list of useful references for understanding both Docker and Docker/FreeBSD.