LinuxCommandLibrary

docker-commit

Create a new image from a container’s changes.

TLDR

Create an image from a specific container

$ docker commit [container] [image]:[tag]
copy


Apply a CMD Dockerfile instruction to the created image
$ docker commit --change="CMD [command]" [container] [image]:[tag]
copy


Apply an ENV Dockerfile instruction to the created image
$ docker commit --change="ENV [name]=[value]" [container] [image]:[tag]
copy


Create an image with a specific author in the metadata
$ docker commit --author="[author]" [container] [image]:[tag]
copy


Create an image with a specific comment in the metadata
$ docker commit --message="[comment]" [container] [image]:[tag]
copy


Create an image without pausing the container during commit
$ docker commit --pause=[false] [container] [image]:[tag]
copy


Display help
$ docker commit --help
copy

SYNOPSIS

docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]

DESCRIPTION

Alias for docker container commit.

OPTIONS

-a, --author="" Author (e.g., "John Hannibal Smith hannibal@a-team.com ⟨mailto:hannibal@a-team.com⟩")

-c, --change= Apply Dockerfile instruction to the created image

-h, --help[=false] help for commit

-m, --message="" Commit message

-p, --pause[=true] Pause container during commit

SEE ALSO

docker(1)

Copied to clipboard