|
@@ -694,6 +694,7 @@ you refer to it on the command line.
|
|
|
Create a new image from a container's changes
|
|
|
|
|
|
-a, --author="" Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
|
|
|
+ -c, --change=[] Apply specified Dockerfile instructions while committing the image
|
|
|
-m, --message="" Commit message
|
|
|
-p, --pause=true Pause container during commit
|
|
|
|
|
@@ -708,7 +709,12 @@ while the image is committed. This reduces the likelihood of
|
|
|
encountering data corruption during the process of creating the commit.
|
|
|
If this behavior is undesired, set the 'p' option to false.
|
|
|
|
|
|
-#### Commit an existing container
|
|
|
+The `--change` option will apply `Dockerfile` instructions to the image
|
|
|
+that is created.
|
|
|
+Supported `Dockerfile` instructions: `CMD`, `ENTRYPOINT`, `ENV`, `EXPOSE`,
|
|
|
+`ONBUILD`, `USER`, `VOLUME`, `WORKDIR`
|
|
|
+
|
|
|
+#### Commit a container
|
|
|
|
|
|
$ sudo docker ps
|
|
|
ID IMAGE COMMAND CREATED STATUS PORTS
|
|
@@ -720,6 +726,19 @@ If this behavior is undesired, set the 'p' option to false.
|
|
|
REPOSITORY TAG ID CREATED VIRTUAL SIZE
|
|
|
SvenDowideit/testimage version3 f5283438590d 16 seconds ago 335.7 MB
|
|
|
|
|
|
+#### Commit a container with new configurations
|
|
|
+
|
|
|
+ $ sudo docker ps
|
|
|
+ ID IMAGE COMMAND CREATED STATUS PORTS
|
|
|
+ c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours
|
|
|
+ 197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours
|
|
|
+ $ sudo docker inspect -f "{{ .Config.Env }}" c3f279d17e0a
|
|
|
+ [HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]
|
|
|
+ $ sudo docker commit --change "ENV DEBUG true" c3f279d17e0a SvenDowideit/testimage:version3
|
|
|
+ f5283438590d
|
|
|
+ $ sudo docker inspect -f "{{ .Config.Env }}" f5283438590d
|
|
|
+ [HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DEBUG=true]
|
|
|
+
|
|
|
## cp
|
|
|
|
|
|
Copy files/folders from a container's filesystem to the host
|
|
@@ -1137,11 +1156,18 @@ NOTE: Docker will warn you if any containers exist that are using these untagged
|
|
|
tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then
|
|
|
optionally tag it.
|
|
|
|
|
|
+ -c, --change=[] Apply specified Dockerfile instructions while importing the image
|
|
|
+
|
|
|
URLs must start with `http` and point to a single file archive (.tar,
|
|
|
.tar.gz, .tgz, .bzip, .tar.xz, or .txz) containing a root filesystem. If
|
|
|
you would like to import from a local directory or archive, you can use
|
|
|
the `-` parameter to take the data from `STDIN`.
|
|
|
|
|
|
+The `--change` option will apply `Dockerfile` instructions to the image
|
|
|
+that is created.
|
|
|
+Supported `Dockerfile` instructions: `CMD`, `ENTRYPOINT`, `ENV`, `EXPOSE`,
|
|
|
+`ONBUILD`, `USER`, `VOLUME`, `WORKDIR`
|
|
|
+
|
|
|
#### Examples
|
|
|
|
|
|
**Import from a remote location:**
|
|
@@ -1160,6 +1186,10 @@ Import to docker via pipe and `STDIN`.
|
|
|
|
|
|
$ sudo tar -c . | sudo docker import - exampleimagedir
|
|
|
|
|
|
+**Import from a local directory with new configurations:**
|
|
|
+
|
|
|
+ $ sudo tar -c . | sudo docker import --change "ENV DEBUG true" - exampleimagedir
|
|
|
+
|
|
|
Note the `sudo` in this example – you must preserve
|
|
|
the ownership of the files (especially root ownership) during the
|
|
|
archiving with tar. If you are not root (or the sudo command) when you
|