pupdates

OCI Containers on FreeBSD

Last updated: 2023-05-14.

Summary

To run FreeBSD or Linux containers:

  1. Install packages: pkg install runj containerd nerdctl
  2. Enable containerd: sysrc containerd_enable="YES" && service containerd start
  3. Run a container: nerdctl run --rm -it knast/freebsd:13-STABLE

For Linux containers, pass --platform linux/amd64 to nerdctl run.

I’m still trying to find a way to build containers.

Requirements

You need:

Running Containers

For FreeBSD containers:

nerdctl run --net none -it knast/freebsd:13-STABLE

TODO: Figure out why dougrabson/freebsd-minimal:13 isn’t working.

For Linux containers:

nerdctl run --platform linux/amd64 --rm -it debian:11-slim

Networking

TODO.

Relevant link: https://samuel.karp.dev/blog/2022/12/docker-style-networking-for-freebsd-jails-with-runj/.

Building Containers

BuildKit, which both docker build and nerdctl build use by default, is still in the process of being ported to FreeBSD.

TODO: Investigate Buildah and other approaches.