Live-migrating a stateful container with minimal downtime.
AdvancedScenarioVolumes, storage and data
Answer
Situation read → Docker does not support live migration (CRIU checkpoint is experimental).
What I'd do →
- For a DB, set up replication to the new host, wait for lag zero, promote, repoint clients.
- For file-based state,
rsyncwhile running, then stop, finalrsync, start on the new host. - Lower DNS TTL beforehand.
Why → Application-level replication is reliable; container checkpoint/restore is not production-grade.
Interview tip → Mention podman container checkpoint exists but is niche.
More on Volumes, storage and data
A Postgres container was removed and the data is gone. How should it have been run?BeginnerBind mount or named volume for local development of a Node app?BeginnerHow do you back up a named volume?IntermediateTwo containers must share files. What are your options?BeginnerA container needs a writable temp area but the root filesystem is read-only.IntermediateMoving a database volume from one Docker host to another.Intermediate