github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/man/docker-import.1.md (about) 1 % DOCKER(1) Docker User Manuals 2 % Docker Community 3 % JUNE 2014 4 # NAME 5 docker-import - Create an empty filesystem image and import the contents of the tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then optionally tag it. 6 7 # SYNOPSIS 8 **docker import** 9 [**-c**|**--change**[=*[]*]] 10 [**-m**|**--message**[=*MESSAGE*]] 11 [**--help**] 12 file|URL|**-**[REPOSITORY[:TAG]] 13 14 # OPTIONS 15 **-c**, **--change**=[] 16 Apply specified Dockerfile instructions while importing the image 17 Supported Dockerfile instructions: `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` 18 19 **--help** 20 Print usage statement 21 22 **-m**, **--message**="" 23 Set commit message for imported image 24 25 # DESCRIPTION 26 Create a new filesystem image from the contents of a tarball (`.tar`, 27 `.tar.gz`, `.tgz`, `.bzip`, `.tar.xz`, `.txz`) into it, then optionally tag it. 28 29 30 # EXAMPLES 31 32 ## Import from a remote location 33 34 # docker import http://example.com/exampleimage.tgz example/imagerepo 35 36 ## Import from a local file 37 38 Import to docker via pipe and stdin: 39 40 # cat exampleimage.tgz | docker import - example/imagelocal 41 42 Import with a commit message. 43 44 # cat exampleimage.tgz | docker import --message "New image imported from tarball" - exampleimagelocal:new 45 46 Import to a Docker image from a local file. 47 48 # docker import /path/to/exampleimage.tgz 49 50 51 ## Import from a local file and tag 52 53 Import to docker via pipe and stdin: 54 55 # cat exampleimageV2.tgz | docker import - example/imagelocal:V-2.0 56 57 ## Import from a local directory 58 59 # tar -c . | docker import - exampleimagedir 60 61 ## Apply specified Dockerfile instructions while importing the image 62 This example sets the docker image ENV variable DEBUG to true by default. 63 64 # tar -c . | docker import -c="ENV DEBUG true" - exampleimagedir 65 66 # See also 67 **docker-export(1)** to export the contents of a filesystem as a tar archive to STDOUT. 68 69 # HISTORY 70 April 2014, Originally compiled by William Henry (whenry at redhat dot com) 71 based on docker.com source material and internal work. 72 June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>