capabilities.work

Snapshot a Running Container as an Image

A 6-step recipe with Docker. We can help you get access.

Recipe · 6 steps

Snapshot a Running Container as an Image

with Docker

Pause a container, commit it to an image, resume it, and tag the result.

  1. Confirm the container is running and capture the image and config it was started from, so the snapshot can be traced back to its origin.
  2. Pause the container so its filesystem is quiesced while the commit reads it. Committing a container under active write load risks capturing a torn state.
  3. Commit the paused container's filesystem into a new image under the target repository and tag. The pause query parameter is set false here because the flow has already paused the container explicitly.
  4. Resume the container immediately after the commit. This step is mandatory — a flow that pauses a production container and does not resume it has taken an outage to take a snapshot.
  5. Confirm the container is running and no longer paused before the flow ends, so a failed resume surfaces here rather than in an incident channel.
  6. Apply a registry-qualified tag to the snapshot image so it can be pushed somewhere durable rather than living only on the incident host.
What you'll need to have ready
  • containerId: ID or name of the running container to snapshot.
  • repo: Repository name for the created image (e.g. "myteam/incident-snapshot").
  • tag: Tag name for the created image (e.g. "2026-07-17").
  • comment: Commit message recorded on the image.
  • author: Author of the image, e.g. "Jane Doe <jane@example.com>".
  • registryRepo: Registry-qualified repository to tag the snapshot into for pushing.
  • registryTag: Tag to apply in the registry-qualified repository.
For your developer

Arazzo workflow docker:commit-container-to-image, 6 operations: ContainerInspect → ContainerPause → ImageCommit → ContainerUnpause → ContainerInspect → ImageTag. Specs on APIs.io.