work on #11094 allow import from local file

Signed-off-by: Gildas Cuisinier <gildas.cuisinier@gcuisinier.net>
This commit is contained in:
Gildas Cuisinier 2015-03-29 19:42:11 +02:00 committed by Tibor Vass
parent e1c14885ee
commit c1571b2a74
2 changed files with 19 additions and 6 deletions

View File

@ -1457,7 +1457,7 @@ NOTE: Docker will warn you if any containers exist that are using these untagged
## import ## import
Usage: docker import URL|- [REPOSITORY[:TAG]] Usage: docker import file|URL|- [REPOSITORY[:TAG]]
Create an empty filesystem image and import the contents of the Create an empty filesystem image and import the contents of the
tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then
@ -1465,10 +1465,14 @@ NOTE: Docker will warn you if any containers exist that are using these untagged
-c, --change=[] Apply specified Dockerfile instructions while importing the image -c, --change=[] Apply specified Dockerfile instructions while importing the image
URLs must start with `http` and point to a single file archive (.tar, You can specify a `URL` or `-` (dash) to take data directly from `STDIN`. The
.tar.gz, .tgz, .bzip, .tar.xz, or .txz) containing a root filesystem. If `URL` can point to an archive (.tar, .tar.gz, .tgz, .bzip, .tar.xz, or .txz)
you would like to import from a local directory or archive, you can use containing a fileystem or to an individual file on the Docker host. If you
the `-` parameter to take the data from `STDIN`. specify an archive, Docker untars it in the container relative to the `/`
(root). If you specify an individual file, you must specify the full path within
the host. To import from a remote location, specify a `URI` that begins with the
`http://` or `https://` protocol.
The `--change` option will apply `Dockerfile` instructions to the image The `--change` option will apply `Dockerfile` instructions to the image
that is created. that is created.
@ -1477,6 +1481,10 @@ Supported `Dockerfile` instructions:
#### Examples #### Examples
**Import from a local file archive:**
$ sudo docker import /local/path/to/exampleimage.tgz exampleimagedir
**Import from a remote location:** **Import from a remote location:**
This will create a new untagged image. This will create a new untagged image.

View File

@ -8,7 +8,7 @@ docker-import - Create an empty filesystem image and import the contents of the
**docker import** **docker import**
[**-c**|**--change**[= []**]] [**-c**|**--change**[= []**]]
[**--help**] [**--help**]
URL|- [REPOSITORY[:TAG]] file|URL|- [REPOSITORY[:TAG]]
# OPTIONS # OPTIONS
**-c**, **--change**=[] **-c**, **--change**=[]
@ -35,6 +35,11 @@ Import to docker via pipe and stdin:
# cat exampleimage.tgz | docker import - example/imagelocal # cat exampleimage.tgz | docker import - example/imagelocal
Import to a Docker image from a local file.
# docker import /path/to/exampleimage.tgz
## Import from a local file and tag ## Import from a local file and tag
Import to docker via pipe and stdin: Import to docker via pipe and stdin: