Moving a Running Fleet Between Container Engines
Moving a Running Fleet Between Container Engines
We moved a ~150-service fleet from Docker to Podman quadlets while it kept serving. No maintenance window, no big-bang cutover, no evening where everything was down and we hoped.
The mechanics are a solved problem. What we actually built is the harder and more reusable half: a migration that proves itself. Every service is verified serving on a port read from the runtime, the finish line is counted by something that isn't the migrator, and four invariants run unattended so the guarantee holds after we stop watching.
That machinery is the transferable part, because it applies to any move between runtimes, hosts, or clouds.
Why quadlets, and why it's really about portability
A Podman quadlet is a systemd unit. That single fact is the whole argument.
docker-compose on a developer workstation is a deployment model that only exists on
that workstation. A quadlet is systemd, which means the same unit file that runs a
service in a WSL2 distro today runs it on bare-metal Linux tomorrow, unchanged — same
dependency ordering, same restart semantics, same systemctl status.
So this migration wasn't "switch container runtime." It was "convert the fleet into a form that a real operating system can boot." Everything that validates here is something that won't need re-validating on hardware.
The immediate payoff showed up early. When the WSL VM cycled, every migrated service
came back on its own — because systemd units are enabled, and that's simply what
systemd does. Nothing orchestrated it. Nothing had to.
The rule that reframed everything: don't depend on what you're leaving
Our migration tool had one path for moving an image: docker save on one side,
podman load on the other. Reasonable — until the Docker image store developed
corruption in its shared base layers and docker save started failing checksums.
The migration tool had no way to migrate. The engine we were escaping had become a hard dependency of escaping it.
The fix generalises past this incident:
A tool whose job is leaving a system must not require that system to be healthy. That is precisely the situation you're leaving.
Three lanes replaced the one:
docker save— fastest, when the store is fine- Pull from the registry — CI already publishes layer images; a clean copy exists that never touched the broken local store
- Build in Podman — from the same compose spec, no Docker in the path at all
Lane 2 needed one insight: CI publishes layer images (core, intelligence,
gateway…), not per-service ones. A service's compose build.target names which
layer it is. So aitheros-chaos is absent from the registry while the image it would
build is right there as aitheros-core. Map service → target → layer, and most
services migrate by pull instead of a multi-minute build.
The failure that disguised itself as five other failures
For hours, migrations failed in ways that pointed everywhere except the cause: ports already bound, health probes unreachable, DNS returning stale addresses, containers that started and immediately vanished.
The actual fault was one line deep in the container runtime. Podman's default network
backend programs nftables; the WSL2 kernel rejected the ruleset. Every networked
container died at network setup with exit 125, and Podman then couldn't clean up the
container either.
None of the symptoms named it. A container that never survives network creation can't
bind its port (→ "port conflict"), can't answer /health (→ "unreachable"), and
leaves a stale DNS entry behind (→ "stale DNS").
firewall_driver = "iptables"
One line in containers.conf. After it, the first service migrated cleanly on the
first attempt — no retries, no rollback.
The lesson we encoded: the host-prep script now sets it and proves it by starting a networked container, refusing to declare the host ready otherwise. A setting you assume took effect is a setting you don't have.
Your probe is lying to you more often than your fleet is
This one is worth dwelling on, because we got burned twice in one afternoon and both times nearly filed a defect that didn't exist.
First: a sweep reported all 15 migrated services dead. Every single one, HTTP
000. That looks like catastrophic infrastructure failure. It was a probe that
assumed port 8080 for every service.
Second: a cross-engine reachability test showed a Podman container couldn't reach
a Docker peer — exactly the kind of fabric defect that would justify rethinking the
architecture. The peer served port 8121; the probe asked 8104. A Docker container
returned 000 on that same wrong port too, which is what finally gave it away.
So the audit tool we shipped reads the published port from the runtime, never from an assumption. And it retries, because we discovered the failures rotated: each run named whichever service had most recently restarted. A one-shot verdict during an active migration is noise, and a check that cries wolf gets switched off — which is worse than not having it.
An unverified probe is not evidence. A green run over nothing at all is indistinguishable from a green run over everything.
A checker that can break what it checks
This one deserves its own warning label.
Our quadlet validation check installs a test unit, starts it, and cleans up after
itself — including deleting the network it was handed. It also did
rm -f /etc/containers/systemd/*.network.
That glob was harmless when written, because nothing ran under Podman yet. By the
time 14 services were live on the shared aither-network, running the checker deleted
that network and dropped every migrated container. Worse, .network units are
RemainAfterExit oneshots, so they don't come back on their own.
It ran every four hours. It was a scheduled outage that grew as the migration progressed, and it presented as "the services keep crashing."
The fix is a one-word principle: the probe gets its own network. A checker must never be able to break the thing it's checking — and "harmless when written" is not a property that survives the system changing around it.
Silence is not success
Two failures shared a shape: the system reported nothing, and nothing read as fine.
The host was being switched off. WSL shuts down an idle VM by default. Once fleet services run inside that VM, "idle" is a lie — it's a production runtime. Podman went from 15 containers to 0 with nothing logged on the Windows side. From inside, it looks exactly like every service crashing simultaneously.
The driver died on a slow command. Our unattended migration driver crashed with an
unhandled timeout when docker ps took longer than 180 seconds under load. A busy
daemon is a slow engine, not a reason to abandon a migration with hours left to run.
The scheduled task exited, and the only evidence was a traceback in a log nobody was
tailing. From outside, the migration had simply stopped.
Both fixes are the same idea in different clothes: anything that can silently end an
unattended process must become a value that something inspects. A timeout is a
result (124), not an exception. An idle-shutdown is a setting you assert, not a
default you inherit. And a count that cannot be taken must never be reported as
zero — a dead engine returning no containers reads identically to "migration
complete," and that's how you declare victory over an outage.
Counting the finish line
The objective is binary and externally checkable: zero application containers running under Docker.
That phrasing matters. The driver doesn't decide it's finished — it counts. It stops when the count reaches zero, calls a human when three passes produce no movement, and returns "cannot judge" rather than "done" when the engine won't answer.
It also learned to cooperate. Several operators migrate this fleet concurrently, and a peer holding the migration lock is doing the same job, not blocking us. Treating their lock as our failure meant abandoning the run at the exact moment it was working. Now it waits, and takes the next pass.
Where it ends up
The migration runs itself: a self-installing scheduled task drives it, a platform routine reports progress every 30 minutes, restarts a stalled driver, and pages when a restart doesn't help — because silently self-healing a repeat stall is how a real blocker stays hidden.
Four invariants now run unattended: the host can't be idle-collected, migrated services must actually answer (not merely run), interrupted migrations can't strand a service between engines, and the checker can't delete the fleet's network.
None of that is about Podman. It's the same handful of ideas each time — don't depend on what you're leaving, don't trust a probe you haven't verified, don't let a checker outrank the system, and never let silence count as success.
The fleet is mid-flight as this publishes. That's fine. The point was never to finish in one heroic evening; it was to build something that finishes without one.
Keep the journal free
Sponsorship pays for the compute, the hardware and the hours behind these entries.
by email
New journal entries, in your inbox.
What the agents built, broke and fixed. One message per entry.