1DOCKER(1)                          JUNE 2014                         DOCKER(1)
2
3
4

NAME

6       docker-commit - Create a new image from a container's changes
7
8
9

SYNOPSIS

11       docker commit [-a|--author[=AUTHOR]] [-c|--change[=[DOCKERFILE
12       INSTRUCTIONS]]] [--help] [-m|--message[=MESSAGE]] [-p|--pause[=true]]
13       CONTAINER [REPOSITORY[:TAG]]
14
15
16

DESCRIPTION

18       Create a new image from an existing container specified by name or
19       container ID.  The new image will contain the contents of the container
20       filesystem, excluding any data volumes. Refer to docker-tag(1) for more
21       information about valid image and tag names.
22
23
24       While the docker commit command is a convenient way of extending an
25       existing image, you should prefer the use of a Dockerfile and docker
26       build for generating images that you intend to share with other people.
27
28
29

OPTIONS

31       -a, --author=""
32          Author (e.g., "John Hannibal Smith ⟨hannibal@a-team.com⟩")
33
34
35       -c , --change=[]
36          Apply specified Dockerfile instructions while committing the image
37          Supported Dockerfile instructions:
38       CMD|ENTRYPOINT|ENV|EXPOSE|LABEL|ONBUILD|USER|VOLUME|WORKDIR
39
40
41       --help
42         Print usage statement
43
44
45       -m, --message=""
46          Commit message
47
48
49       -p, --pause=true|false
50          Pause container during commit. The default is true.
51
52
53

EXAMPLES

Creating a new image from an existing container

56       An existing Fedora based container has had Apache installed while
57       running in interactive mode with the bash shell. Apache is also
58       running. To create a new image run docker ps to find the container's ID
59       and then run:
60
61
62              # docker commit -m="Added Apache to Fedora base image" \
63                -a="A D Ministrator" 98bd7fc99854 fedora/fedora_httpd:20
64
65
66
67       Note that only a-z0-9-_. are allowed when naming images from an
68       existing container.
69
70

Apply specified Dockerfile instructions while committing the image

72       If an existing container was created without the DEBUG environment
73       variable set to "true", you can create a new image based on that
74       container by first getting the container's ID with docker ps and then
75       running:
76
77
78              # docker commit -c="ENV DEBUG true" 98bd7fc99854 debug-image
79
80
81
82

HISTORY

84       April 2014, Originally compiled by William Henry (whenry at redhat dot
85       com) based on docker.com source material and in June 2014, updated by
86       Sven Dowideit ⟨SvenDowideit@home.org.au⟩ July 2014, updated by Sven
87       Dowideit ⟨SvenDowideit@home.org.au⟩ Oct 2014, updated by Daniel, Dao
88       Quang Minh <daniel at nitrous dot io> June 2015, updated by Sally
89       O'Malley ⟨somalley@redhat.com⟩
90
91
92
93Docker Community              Docker User Manuals                    DOCKER(1)
Impressum