1DOCKER(1)                          JUNE 2014                         DOCKER(1)
2
3
4

NAME

6       docker-import - Create an empty filesystem image and import the
7       contents of the tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz)
8       into it, then optionally tag it.
9
10
11

SYNOPSIS

13       docker import [-c|--change[=[]]] [-m|--message[=MESSAGE]] [--help]
14       file|URL|-[REPOSITORY[:TAG]]
15
16
17

OPTIONS

19       -c, --change=[]
20          Apply specified Dockerfile instructions while importing the image
21          Supported Dockerfile instructions:
22       CMD|ENTRYPOINT|ENV|EXPOSE|ONBUILD|USER|VOLUME|WORKDIR
23
24
25       --help
26         Print usage statement
27
28
29       -m, --message=""
30          Set commit message for imported image
31
32
33

DESCRIPTION

35       Create a new filesystem image from the contents of a tarball (.tar,
36       .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then optionally tag it.
37
38
39

EXAMPLES

Import from a remote location

42              # docker import http://example.com/exampleimage.tgz example/imagerepo
43
44
45

Import from a local file

47       Import to docker via pipe and stdin:
48
49
50              # cat exampleimage.tgz | docker import - example/imagelocal
51
52
53
54       Import with a commit message.
55
56
57              # cat exampleimage.tgz | docker import --message "New image imported from tarball" - exampleimagelocal:new
58
59
60
61       Import to a Docker image from a local file.
62
63
64              # docker import /path/to/exampleimage.tgz
65
66
67

Import from a local file and tag

69       Import to docker via pipe and stdin:
70
71
72              # cat exampleimageV2.tgz | docker import - example/imagelocal:V-2.0
73
74
75

Import from a local directory

77              # tar -c . | docker import - exampleimagedir
78
79
80

Apply specified Dockerfile instructions while importing the image

82       This example sets the docker image ENV variable DEBUG to true by
83       default.
84
85
86              # tar -c . | docker import -c="ENV DEBUG true" - exampleimagedir
87
88
89
90

See also

92       docker-export(1) to export the contents of a filesystem as a tar
93       archive to STDOUT.
94
95
96

HISTORY

98       April 2014, Originally compiled by William Henry (whenry at redhat dot
99       com) based on docker.com source material and internal work.  June 2014,
100       updated by Sven Dowideit ⟨SvenDowideit@home.org.au⟩
101
102
103
104Docker Community              Docker User Manuals                    DOCKER(1)
Impressum