pkg install runj containerd

service containerd onestart

# required dir that should probably be created by containerd anyway

mkdir /var/lib/containerd/io.containerd.snapshotter.v1.zfs

ctr image pull --platform=linux docker.io/library/alpine:latest

ctr run --rm --tty --runtime wtf.sbk.runj.v1 --snapshotter zfs --platform linux docker.io/library/alpine:latest mylinuxcontainer uname -a

Linux 4.4.0 FreeBSD 13.2-RELEASE-p2 GENERIC x86_64 Linux

source: https://productionwithscissors.run/2022/09/04/containerd-linux-on-freebsd/

Reply to this note

Please Login to reply.

Discussion

ctr is from containerd and is lower level than docker itself.

There is a docker port for FreeBSD but it's poopy.

There is a fully docker compatible tool called nerdctl that can be used as a drop in replacement. Also handles docker compose. But it still has some rough edges on FreeBSD.

Also building images from Dockerfiles on FreeBSD is still something I can't figure out yet.