Run OCI images on Atlas: findings and plan

Draft for discussion. Date: 3 November 2026. No Atlas code has changed. The test code is outside the repository.

Result. Docker Hub images boot on Firecracker with no Docker and no container runtime in the guest. We unpack the image into an ext4 disk, add one small init program, and boot it with the Ubuntu kernel that Atlas already uses.

Recommendation. Follow the Fly.io model for the guest. Keep the Atlas storage path: an image becomes a normal Virtual Machine Image with an ext4 root file system. Then ZFS clones, object storage, and host caching work with no first-phase change to the Metal API.

Evidence. nginx from Docker Hub answered HTTP 200 over a TAP device about 840 ms after Firecracker started. A graceful stop, disk growth, and a restart with data also worked.

Limit. All tests ran on a laptop. Nothing ran on an Atlas host or through metald yet.

Why this needs more than an unpacked image

An OCI image is a list of file system layers and one small configuration file. A layer is a tar archive of changed files. The configuration gives the program to start, its environment, its user, and its working directory. Docker Hub stores images in this format.

An OCI image is not a bootable machine. It has no kernel and no init program. Init is the first process that the kernel starts. The image also does not know how to configure the Atlas network.

Today, each Atlas guest gets these jobs from Ubuntu: systemd, cloud-init, apply-metadata, and SSH. Many Docker Hub images have none of these. Some have no shell and no Python. Our init must do the jobs that an Atlas VM needs.

How other providers do it

ProviderIsolationImage to diskGuestRoot disk after restart
Fly.ioFirecrackercontainerd on each host is a cache. It unpacks images into devmapper thin snapshots. Each VM gets a copy-on-write device. Later, Fly added overlayfs with a writable upper layer.Own Rust init. It reads run.json, mounts file systems, sets DNS, runs SSH, and starts the entrypoint.Reset by default. persist_rootfs can keep it. Volumes hold durable data.
DigitalOcean MicroVMsFirecrackerTakes an OCI reference with --oci-ref. The base disk is immutable, content-addressed, and loaded in chunks through ublk. Each execution has a local sparse overlay. The conversion step is not published.Guest init is mentioned. Its design is not published.Files survive a pause. Scratch data clears when the session ends.
RailwayNot publishedWe found no public description of its runtime. Its builder runs in microVMs. Its orchestrator is its own and is not Kubernetes.Not publishedVolumes hold durable data.
firecracker-containerdFirecrackercontainerd with a block snapshotter, such as devmapper.Runs an agent and a container runtime in the guest.Depends on the setup.

What matters for Atlas. Fly needs containerd and devmapper to get thin copy-on-write disks on a host. Atlas already has this with a ZFS volume per image and a ZFS clone per VM. So Atlas does not need containerd.

The DigitalOcean warm path is under 200 ms at p50 in its internal tests. It starts from an existing checkpoint and warm caches, and it excludes first-time image import. Atlas warm images already use a similar idea. Lazy chunk loading is a separate, later project.

What we tested

We pulled nine images from Docker Hub with skopeo, flattened the layers, and applied whiteouts. A whiteout is a marker in a layer that deletes a file from a lower layer. Then we built ext4 with mkfs.ext4 -d, added a 2.8 MiB static Go init, and booted the disk.

Conditions: Fedora laptop on NVMe, Firecracker 1.16.1, Ubuntu kernel 7.0.0-42 (the Atlas HWE kernel source), 2 vCPUs, 1024 MiB memory, one attempt per image unless noted. No jailer, no seccomp, no network device, and full kernel messages on the serial console. A disk file replaced ZFS. Pull time depends on this home connection, so treat it as a rough value.

ImageLayersPull MiBFiles MiBPull sFlatten smkfs sResultPort open*
nginx:1.29-alpine825687.40.40.5ran49 to 74 ms
redis:8-alpine7381208.40.40.9ran163 ms
postgres:171415445123.01.61.5ran, first boot ran initdb862 ms
mariadb:11not readnot read33114.01.21.4failed, then ran after the fix below5147 ms
hashicorp/http-echo:1.0104165.60.20.2ran as UID 65532. Its log reports the port.not probed
traefik:v34531899.70.51.8started. Stayed up. Port 8080 did not open.none
python:3.13-slim44112511.80.70.8Exit 0: no terminal inputn/a
node:22-slimnot readnot read23311.31.01.1Exit 0: no terminal inputn/a
ubuntu:24.04128856.70.50.6Exit 0: bash with no terminal inputn/a

* Time from init start until a TCP connection to the port inside the guest succeeded. This is over loopback, not over the network. The nginx range comes from three boots.

The kernel reached init in about 0.86 s on every boot. This includes slow serial console output. The entrypoint started 6 to 16 ms after init. Flatten plus mkfs took less than 4 s for each image.

Second round: boot, network, stop, and restart

Same laptop and shape. These runs used the Metal default kernel arguments, init at /sbin/init, and a disk file made 1 GiB larger than its file system. The HTTP test ran in a private network namespace with a TAP device, because the test had no root access.

TestResultState
HTTP from outside the guest to nginxHTTP 200. First answer at 831, 837, and 843 ms from Firecracker start with quiet loglevel=0. 1059 ms in one run with full console output.tested
Init at /sbin/init, no init=Booted on Alpine (nginx, the path was a symlink) and on Debian (postgres, /sbin links to usr/sbin).tested
Grow ext4 online with an ioctlnginx: 311 to 1270 MiB in 24 ms. postgres: 791 to 1799 MiB in 8 ms. No resize2fs in the guest.tested
Ctrl+Alt+Del to the image stop signalnginx got SIGQUIT and exited in 31 ms. postgres got SIGINT, logged a clean shutdown, and exited in 19 ms. Firecracker exited with 0. e2fsck found the disks clean.tested
Restart with the same diskpostgres logged "Skipping initialization" on the second boot. Port open 143 ms after init.tested
Guest memory in use, 1 s after port openMemTotal minus MemAvailable: nginx 114 MiB, postgres 172 MiB on first boot and 136 MiB on second. A 1024 MiB VM reports 956 MiB total.tested

Findings that change the design

  1. Do not mount over image directories. Our first init mounted a tmpfs on /run. This hid the /run/mysqld directory that the MariaDB image ships, and the entrypoint failed. We removed the mount and set MARIADB_ROOT_PASSWORD, and the server started. Init must match Docker here, even though Fly mounts /run.
  2. The Ubuntu kernel ignores ip=. The boot log says Unknown kernel command line parameters "ip=...". So eth0 stayed down and our first network test got no answer. Today, Ubuntu guests get their address from a systemd-networkd file in the image. Init must set the address itself. It can read the ip= value that Metal already sends from /proc/cmdline. The comment on bootArguments in Metal does not match this kernel.
  3. An exit is a normal event. ubuntu, python, and node exit at once with code 0, because they expect a terminal. Metal starts a stopped guest when its desired state is running, and a successful start gets no backoff. We read this in the code and did not run it on a host. So an exit that powers off the guest would become a boot loop. See decision 2.
  4. Images are small, so disks can be small. Our test disks were 276 to 819 MiB. The Ubuntu base is a fixed 4 GiB. The VM disk grows from the image size, so init must grow the file system itself. Ubuntu does this with cloud-init today.
  5. Whiteouts are real. postgres and mariadb each had 2. A plain tar extraction would keep files that the image deleted. The converter must handle whiteouts, and opaque whiteouts too, though none appeared in this set.
  6. Each entrypoint expects a different stop signal. nginx declares SIGQUIT and postgres declares SIGINT. Metal stops a guest with Ctrl+Alt+Del. By default the Linux kernel reboots at once on this event. Init turns this off with LINUX_REBOOT_CMD_CAD_OFF, receives SIGINT, and sends the image stop signal. This worked in the second round.
  7. Kernel modules are large. The Ubuntu modules package is 166 MiB compressed. Ubuntu images install it so that Docker and BPF work in the guest. Start without it. An image that needs modprobe will not get that module.
  8. Docker Hub limits are low for a fleet. The docs give 100 pulls per 6 hours per IP for anonymous use, and 200 per 6 hours for a free account. The response headers we saw said 100;w=3600, so the docs and the headers differ. Docker also warns about abuse limits for platforms that pull for many users from one address. Pull each digest once. Do not pull once per host.

Approaches

Where does the image become a disk?

A and C pull one time and store one disk. B pulls on each host and runs untrusted archive parsing in the host daemon.
OptionGoodBadView
A. Atlas background jobSmallest change. One pull for each digest. The result uses the current image path.A tenant image would feed an untrusted archive to the control plane. Large images use Atlas worker disk.Use first, for images an operator selects.
B. Metal host at first use (Fly style)No object storage copy. Close to Fly.Root daemon parses untrusted archives. Each host pulls, so rate limits apply. Two hosts can build different ext4 bytes, but Metal binds an image reference to one SHA-256. VM create waits for the conversion.Reject.
C. Temporary builder VMA hostile archive reaches only a guest. One pull for each digest. It can upload through the current signed multipart path.More moving parts. Needs a builder image, a network, and job tracking. The warm image temporary VM has no network, so it cannot be reused as it is.Use for tenant images.
D. containerd on hosts, or firecracker-containerdTested projects, with layer sharing.Adds a daemon and a second image store on each host, next to ZFS. Duplicates what Atlas owns.Reject.
E. Docker inside an Ubuntu VMWorks today with no Atlas change.Not the goal. Adds a full OS and a daemon. Boots slower.Rejected by the requester.

One converter binary serves A and C. So moving from A to C changes where it runs and does not rewrite it.

How does init get into the guest?

OptionEffectView
Write init to /sbin/init in the diskThe kernel starts it by default, so Metal needs no boot change. One disk and one digest. A new init needs a new image build, as apply-metadata does today. If the image has its own /sbin/init, the builder moves it. On Alpine this path is a symlink to BusyBox, so replace the link and do not write through it. An absolute symlink in an image must not lead the converter out of its directory. Tested on Alpine and Debian images.Recommended.
Add boot arguments to the Metal image requestExplicit. Needs a Metal API field and host upgrades. Metal reads a boot-args file today, but in the repository only the development script writes it.Use only if the first option fails.
Separate small init drive (Fly's public init)Init can change with no rebuild. Metal must add a second drive to boot, rescue, and migration. Device names change.Reject for now.

Proposed design

New parts are green. Everything else exists today.

Trace one image

  1. An operator runs a command with nginx:1.29-alpine. The converter resolves the tag to a digest. Atlas stores the digest, because a tag can move.
  2. The converter reads the amd64 manifest, applies the layers in order, adds init and /.atlas/image.json, and builds ext4. It never mounts the result on a host.
  3. Atlas uploads the compressed disk and creates a Virtual Machine Image. It links an existing kernel record. It gets the tag purpose=oci, so get_latest_base_image ignores it.
  4. A VM create request sends the same Metal image object as today: URLs, digests, and architecture. Metal downloads, verifies, clones, and boots, with no OCI knowledge.
  5. Init configures the guest, then starts the entrypoint.

What init must do

JobToday on UbuntuIn Atlas initState
Mount /proc, /sys, /dev, cgroup2systemdMount only these. Do not mount over image directories.tested
Start entrypoint with env, user, directoryn/aFrom image.json, plus overrides from attributes in the metadata service (MMDS).tested without overrides
Reap child processes as PID 1systemdWait for all children.tested
IPv4 addresssystemd-networkd file in the imageRead ip= from /proc/cmdline and set the address by netlink or ioctl. The kernel passes unknown arguments to init, so do not pass them to the entrypoint.tested with a fixed address
MTU 1380, IPv4 and metadata routes, DNS, /etc/hostssystemd-networkdSet by netlink. Write the DNS and hosts files.proposed
Mesh IPv6 address and host routesapply-metadata (Python)Poll MMDS every 250 ms and apply by netlink. Images may have no Python or ip.proposed
Clock step after memory restoreapply-metadataSame rule: forward only, gap above 2 s.proposed
Grow file systemcloud-initOnline ext4 resize ioctl at boot and after a disk resize. Images may have no resize2fs.tested at boot
Graceful stopsystemdDisable Ctrl+Alt+Del reboot. Send the image stop signal, wait, sync, and power off.tested
Entrypoint exitn/aKeep the guest running. Restart the entrypoint with a growing delay. Write the exit code to the console.proposed
SSH keys and user_datasshd, cloud-initNot available. See decisions 4 and 5.open

The metadata logic would then exist in Python and in Go. Later, Ubuntu images can use the Go program too, so one implementation remains. Do this as a separate change, because it touches all current images.

What changes in each component

ComponentChangeCompatibility
Guest init (new Go binary)Jobs above. Static build. Lives in the Metal Go module. Exact path is for review.New images only.
Converter (new)Pull, flatten, make ext4. Enforce limits on size and file count. Reject unsafe paths. Consider go-containerregistry for pull and flatten, and mke2fs -d with a tar input to avoid root. mke2fs 1.47 documents this when built with libarchive. Not tested.New.
Atlas appA build command in image_builder.py style. Optional source reference and digest on the image. Later, a tenant import route.Optional fields and a Frappe patch. DocType layout needs a mockup and approval first.
MetalNone in the first phase. Init owns the restart of the entrypoint, so the guest does not power off when its program exits.No API or record change expected.
Migration, sleep, warm, rescueNo planned code change. The VM is still Firecracker on a ZFS disk. Each needs a test, and init must keep MMDS polling so that a restored guest gets its address.Must be proven by test.

Plan

PhaseWorkDepends onDone when
0Local boot, network, stop, growth, and restart tests. doneResults above.
1Guest init with network, MMDS, growth, and stop. Boot on a development host from a hand-built disk.Decisions 2 and 3nginx answers over mesh IPv6 and the public path. Stop uses the image signal. Disk resize grows the file system.
2Converter and operator command (option A). Public Docker Hub images. Docs.1The nine images above publish as Available images and boot through the normal VM create flow on a development host.
3Test each Atlas feature. Add command and environment overrides. Add exit handling and console access.2, decisions 2 and 5Restart, migration, sleep and wake, warm start, snapshot, and rescue pass on nginx and postgres. A failed entrypoint is visible to the operator.
4Tenant import with a builder VM (option C). Registry credentials. Quotas. Docker Hub paid token.3, decision 1A hostile archive test stays inside the builder VM. Import failures show on the image record. Retries are safe.
LaterShare layers between images, lazy loading, arm64, one metadata agent for Ubuntu and OCI.Evidence of needMeasured import or boot delay justifies the work.

Decisions for discussion

  1. Who uses this first? Operator-selected images, or tenants? Recommendation: operators first. Tenant import brings the untrusted archive problem, registry credentials, and quotas.
  2. What happens when the entrypoint exits? Options: power off, or keep the guest up and restart the program. A power off needs a Metal change, because Metal starts the guest again while the desired state is running. Recommendation: init restarts the entrypoint with a delay that grows to 60 s, and writes the exit code to the console. The VM stays Running in Atlas, so a failing program does not show in the VM state. Exit codes in the API can come later.
  3. Does the root disk survive a restart? Fly resets by default. Atlas VMs keep their disk. Recommendation: keep the disk. This is the current Atlas contract, and migration, snapshots, and databases depend on it. A reset mode can come later.
  4. What does user_data do on an OCI image? It has no cloud-init. Recommendation: reject the request with a clear error, and do not ignore it silently. This is a new image kind, so no existing client breaks.
  5. How does a person get a shell? Fly has SSH and an API built into init. DigitalOcean has an exec API. Many images have no shell. Recommendation: first phase shows output on the TTY console only. Then add exec through init over vsock or the serial console. The Atlas SSH console needs an SSH service and the key lookup in the guest, so it does not work on these images. The TTY console collects output while the VM runs.
  6. How does an image update work? The disk holds both the image files and the data, so a new image cannot replace the old one in place. Recommendation: a new image means a new VM until network volumes exist. Fly can replace it because its volumes are separate. This is the largest product difference from Fly.

Risks and limits

Not tested yet

Sources