1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 19:02:09 +02:00
tldr/pages/common/docker-commit.md
Nelson Figueroa de7667eeaa
docker-commit: update documentation link (#13675)
updated docker-commit docs link
2024-09-12 07:30:48 +02:00

32 lines
968 B
Markdown

# docker commit
> Create a new image from a container’s changes.
> More information: <https://docs.docker.com/reference/cli/docker/container/commit/>.
- Create an image from a specific container:
`docker commit {{container}} {{image}}:{{tag}}`
- Apply a `CMD` Dockerfile instruction to the created image:
`docker commit --change "CMD {{command}}" {{container}} {{image}}:{{tag}}`
- Apply an `ENV` Dockerfile instruction to the created image:
`docker commit --change "ENV {{name}}={{value}}" {{container}} {{image}}:{{tag}}`
- Create an image with a specific author in the metadata:
`docker commit --author "{{author}}" {{container}} {{image}}:{{tag}}`
- Create an image with a specific comment in the metadata:
`docker commit --message "{{comment}}" {{container}} {{image}}:{{tag}}`
- Create an image without pausing the container during commit:
`docker commit --pause {{false}} {{container}} {{image}}:{{tag}}`
- Display help:
`docker commit --help`