-
Notifications
You must be signed in to change notification settings - Fork 692
Support deploying containers without starting them (for standby/pre-warm workflows) #1809
Description
We'd like to request support for a standby/pre-provision workflow where Kamal prepares containers on a host without starting them yet.
Problem
Some deployment workflows require containers to be fully configured and image-pulled on a host but left in a stopped state, to be activated later with kamal app start. Examples include:
- Failover standby servers — keep a warm-standby host with containers fully prepared. On failover,
kamal app startactivates them near-instantly (image already pulled, container already allocated) rather than requiring a fullkamal deployunder pressure. - Precise maintenance windows — do all the slow work (build, push, pull, create) ahead of time; the actual switchover at the maintenance window is just a
start. - Blue/green with deferred cutover — pre-create the "green" containers while "blue" is live; flip at a controlled moment.
Docker's docker create command supports this directly: it allocates the container—filesystem, networking, environment, labels, volumes—but leaves it in the Created state without spawning any processes.
Proposed solution
Expose docker create through kamal so the above workflows are possible without requiring users to construct the docker command manually (which would need to mirror kamal's env args, label args, volume args, network config, etc.).
We have a reference implementation in this PR that takes the form of explicit create subcommands mirroring boot:
kamal app create— creates all app containers without starting themkamal accessory create [NAME]— creates accessory containers without starting them
An alternate design would add a --create-only flag to kamal deploy, kamal app boot, and kamal accessory boot that substitutes docker create for docker run and skips proxy registration.
We'd welcome direction on which API design better fits kamal's conventions before refining the PR.