PR #11907 added support for import using file (path), but it missed
the update of cli/import.md. This fixes that.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
| ... | ... |
@@ -11,7 +11,7 @@ weight=1 |
| 11 | 11 |
|
| 12 | 12 |
# import |
| 13 | 13 |
|
| 14 |
- Usage: docker import URL|- [REPOSITORY[:TAG]] |
|
| 14 |
+ Usage: docker import file|URL|- [REPOSITORY[:TAG]] |
|
| 15 | 15 |
|
| 16 | 16 |
Create an empty filesystem image and import the contents of the |
| 17 | 17 |
tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then |
| ... | ... |
@@ -19,10 +19,13 @@ weight=1 |
| 19 | 19 |
|
| 20 | 20 |
-c, --change=[] Apply specified Dockerfile instructions while importing the image |
| 21 | 21 |
|
| 22 |
-URLs must start with `http` and point to a single file archive (.tar, |
|
| 23 |
-.tar.gz, .tgz, .bzip, .tar.xz, or .txz) containing a root filesystem. If |
|
| 24 |
-you would like to import from a local directory or archive, you can use |
|
| 25 |
-the `-` parameter to take the data from `STDIN`. |
|
| 22 |
+You can specify a `URL` or `-` (dash) to take data directly from `STDIN`. The |
|
| 23 |
+`URL` can point to an archive (.tar, .tar.gz, .tgz, .bzip, .tar.xz, or .txz) |
|
| 24 |
+containing a fileystem or to an individual file on the Docker host. If you |
|
| 25 |
+specify an archive, Docker untars it in the container relative to the `/` |
|
| 26 |
+(root). If you specify an individual file, you must specify the full path within |
|
| 27 |
+the host. To import from a remote location, specify a `URI` that begins with the |
|
| 28 |
+`http://` or `https://` protocol. |
|
| 26 | 29 |
|
| 27 | 30 |
The `--change` option will apply `Dockerfile` instructions to the image |
| 28 | 31 |
that is created. |
| ... | ... |
@@ -43,6 +46,10 @@ Import to docker via pipe and `STDIN`. |
| 43 | 43 |
|
| 44 | 44 |
$ cat exampleimage.tgz | docker import - exampleimagelocal:new |
| 45 | 45 |
|
| 46 |
+Import to docker from a local archive. |
|
| 47 |
+ |
|
| 48 |
+ $ docker import /path/to/exampleimage.tgz |
|
| 49 |
+ |
|
| 46 | 50 |
**Import from a local directory:** |
| 47 | 51 |
|
| 48 | 52 |
$ sudo tar -c . | docker import - exampleimagedir |