Skip to content

Docker commit operation

The Docker commit operation is a CLI command used to create a new image from a container's current state.^[400-devops__03-Containerization__query-io.md]

Usage

The basic syntax for the command requires the container ID and the target repository name for the new image.^[400-devops__03-Containerization__query-io.md]

docker commit [CONTAINER_ID] [REPOSITORY_NAME]

For example, to save the state of a running container to a specific repository, one would execute the command like this:^[400-devops__03-Containerization__query-io.md]

docker commit e23d4b149bf0 [Quay.io](<./quayio.md>)/tommyunistar/yudady

Workflow Context

This command is typically used in a workflow involving a container registry. After committing the container state to an image, the image can be pushed to the registry (such as Quay.io) to persist the changes.^[400-devops__03-Containerization__query-io.md]

  • [[Docker]]
  • [[Container registry]]

Sources

  • 400-devops__03-Containerization__query-io.md