# A machine that runs a Docker daemon inside itself, for workloads that must # call Docker themselves: Testcontainers, Compose, image builds, agents that # launch containers. smolvm boots OCI images without Docker, so this is only for # software inside the machine that needs the daemon. # # For v1.28.0 and earlier, which have no disk volumes; from v1.28.1 use # docker.smolfile. The bind mounts below are in `init`, as in the upstream # example, and `init` runs ONCE: they hold for the first boot only. # scripts/start-dockerd.sh, the example's "Start dockerd" recipe, re-applies # them on every start. cpus = 2 memory = 2048 net = true # Docker's data directory must live on /storage, not on the rootfs overlay. # This is a hard requirement: the rootfs overlay uses the initramfs (ramfs) as # its lower layer, ramfs has no file-handle support, and overlayfs then rejects # it as an upper dir for Docker's nested overlay. storage = 20 docker_socket = true init = [ "apk update -q", "apk add docker -q", "mkdir -p /storage/docker /var/lib/docker /storage/containerd /var/lib/containerd", "mount --bind /storage/docker /var/lib/docker", "mount --bind /storage/containerd /var/lib/containerd", ]