2014-04-16 14:07:55 -04:00
|
|
|
% DOCKER(1) Docker User Manuals
|
2014-06-30 22:58:04 -04:00
|
|
|
% Docker Community
|
|
|
|
% JUNE 2014
|
2014-04-16 14:07:55 -04:00
|
|
|
# NAME
|
2014-06-30 22:58:04 -04:00
|
|
|
docker-commit - Create a new image from a container's changes
|
2014-04-16 14:07:55 -04:00
|
|
|
|
|
|
|
# SYNOPSIS
|
2014-06-30 22:58:04 -04:00
|
|
|
**docker commit**
|
|
|
|
[**-a**|**--author**[=*AUTHOR*]]
|
2014-10-15 17:14:12 -04:00
|
|
|
[**--help**]
|
2015-01-09 16:08:26 -05:00
|
|
|
[**-c**|**--change**[= []**]]
|
2014-06-30 22:58:04 -04:00
|
|
|
[**-m**|**--message**[=*MESSAGE*]]
|
2014-07-22 22:40:10 -04:00
|
|
|
[**-p**|**--pause**[=*true*]]
|
2014-11-27 23:21:55 -05:00
|
|
|
CONTAINER [REPOSITORY[:TAG]]
|
2014-04-16 14:07:55 -04:00
|
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
Using an existing container's name or ID you can create a new image.
|
|
|
|
|
|
|
|
# OPTIONS
|
2014-06-30 22:58:04 -04:00
|
|
|
**-a**, **--author**=""
|
|
|
|
Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
|
2014-04-16 14:07:55 -04:00
|
|
|
|
2015-01-09 16:08:26 -05:00
|
|
|
**-c** , **--change**=[]
|
2015-02-05 06:26:05 -05:00
|
|
|
Apply specified Dockerfile instructions while committing the image
|
2015-03-17 00:49:33 -04:00
|
|
|
Supported Dockerfile instructions: ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|LABEL|VOLUME|WORKDIR|COPY
|
2015-01-09 16:08:26 -05:00
|
|
|
|
2014-10-15 17:14:12 -04:00
|
|
|
**--help**
|
|
|
|
Print usage statement
|
|
|
|
|
2014-06-30 22:58:04 -04:00
|
|
|
**-m**, **--message**=""
|
2014-04-16 14:07:55 -04:00
|
|
|
Commit message
|
|
|
|
|
2014-07-22 22:40:10 -04:00
|
|
|
**-p**, **--pause**=*true*|*false*
|
|
|
|
Pause container during commit. The default is *true*.
|
2014-06-30 20:39:38 -04:00
|
|
|
|
2014-04-16 14:07:55 -04:00
|
|
|
# EXAMPLES
|
|
|
|
|
|
|
|
## Creating a new image from an existing container
|
2014-04-21 13:55:06 -04:00
|
|
|
An existing Fedora based container has had Apache installed while running
|
2014-04-16 14:07:55 -04:00
|
|
|
in interactive mode with the bash shell. Apache is also running. To
|
2014-04-17 11:36:58 -04:00
|
|
|
create a new image run docker ps to find the container's ID and then run:
|
2014-04-16 14:07:55 -04:00
|
|
|
|
2014-06-04 21:41:45 -04:00
|
|
|
# docker commit -m="Added Apache to Fedora base image" \
|
2014-06-04 21:25:55 -04:00
|
|
|
-a="A D Ministrator" 98bd7fc99854 fedora/fedora_httpd:20
|
2014-04-16 14:07:55 -04:00
|
|
|
|
2015-02-05 06:26:05 -05:00
|
|
|
## Apply specified Dockerfile instructions while committing the image
|
|
|
|
If an existing container was created without the DEBUG environment
|
|
|
|
variable set to "true", you can create a new image based on that
|
|
|
|
container by first getting the container's ID with docker ps and
|
|
|
|
then running:
|
2015-01-09 16:08:26 -05:00
|
|
|
|
|
|
|
# docker commit -c="ENV DEBUG true" 98bd7fc99854 debug-image
|
|
|
|
|
2014-04-16 14:07:55 -04:00
|
|
|
# HISTORY
|
|
|
|
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
|
2014-07-01 20:30:25 -04:00
|
|
|
based on docker.com source material and in
|
2014-06-30 22:58:04 -04:00
|
|
|
June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
|
2014-07-22 22:40:10 -04:00
|
|
|
July 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
|
2015-01-09 16:08:26 -05:00
|
|
|
Oct 2014, updated by Daniel, Dao Quang Minh <daniel at nitrous dot io>
|