github.com/docker/docker-ce@v17.12.1-ce-rc2+incompatible/components/cli/man/src/image/import.md (about) 1 Create a new filesystem image from the contents of a tarball (`.tar`, 2 `.tar.gz`, `.tgz`, `.bzip`, `.tar.xz`, `.txz`) into it, then optionally tag it. 3 4 5 # EXAMPLES 6 7 ## Import from a remote location 8 9 # docker image import http://example.com/exampleimage.tgz example/imagerepo 10 11 ## Import from a local file 12 13 Import to docker via pipe and stdin: 14 15 # cat exampleimage.tgz | docker image import - example/imagelocal 16 17 Import with a commit message. 18 19 # cat exampleimage.tgz | docker image import --message "New image imported from tarball" - exampleimagelocal:new 20 21 Import to a Docker image from a local file. 22 23 # docker image import /path/to/exampleimage.tgz 24 25 26 ## Import from a local file and tag 27 28 Import to docker via pipe and stdin: 29 30 # cat exampleimageV2.tgz | docker image import - example/imagelocal:V-2.0 31 32 ## Import from a local directory 33 34 # tar -c . | docker image import - exampleimagedir 35 36 ## Apply specified Dockerfile instructions while importing the image 37 This example sets the docker image ENV variable DEBUG to true by default. 38 39 # tar -c . | docker image import -c="ENV DEBUG true" - exampleimagedir 40 41 # See also 42 **docker-export(1)** to export the contents of a filesystem as a tar archive to STDOUT.