mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-24 04:35:25 +02:00
docker-commit: add page (#6976)
This commit is contained in:
parent
812ebcca53
commit
4bee9674ea
1 changed files with 32 additions and 0 deletions
32
pages/common/docker-commit.md
Normal file
32
pages/common/docker-commit.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# docker commit
|
||||
|
||||
> Create a new image from a container’s changes.
|
||||
> More information: <https://docs.docker.com/engine/reference/commandline/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`
|
Loading…
Add table
Reference in a new issue