|
1 .TH "DOCKER" "1" " Docker User Manuals" "Docker Community" "JUNE 2014" "" |
|
2 |
|
3 |
|
4 .SH NAME |
|
5 .PP |
|
6 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. |
|
7 |
|
8 |
|
9 .SH SYNOPSIS |
|
10 .PP |
|
11 \fBdocker import\fP |
|
12 [\fB\-c\fP|\fB\-\-change\fP[=\fI[]\fP]] |
|
13 [\fB\-m\fP|\fB\-\-message\fP[=\fIMESSAGE\fP]] |
|
14 [\fB\-\-help\fP] |
|
15 file|URL|\fB\-\fP[REPOSITORY[:TAG]] |
|
16 |
|
17 |
|
18 .SH OPTIONS |
|
19 .PP |
|
20 \fB\-c\fP, \fB\-\-change\fP=[] |
|
21 Apply specified Dockerfile instructions while importing the image |
|
22 Supported Dockerfile instructions: \fB\fCCMD\fR|\fB\fCENTRYPOINT\fR|\fB\fCENV\fR|\fB\fCEXPOSE\fR|\fB\fCONBUILD\fR|\fB\fCUSER\fR|\fB\fCVOLUME\fR|\fB\fCWORKDIR\fR |
|
23 |
|
24 .PP |
|
25 \fB\-\-help\fP |
|
26 Print usage statement |
|
27 |
|
28 .PP |
|
29 \fB\-m\fP, \fB\-\-message\fP="" |
|
30 Set commit message for imported image |
|
31 |
|
32 |
|
33 .SH DESCRIPTION |
|
34 .PP |
|
35 Create a new filesystem image from the contents of a tarball (\fB\fC.tar\fR, |
|
36 \fB\fC.tar.gz\fR, \fB\fC.tgz\fR, \fB\fC.bzip\fR, \fB\fC.tar.xz\fR, \fB\fC.txz\fR) into it, then optionally tag it. |
|
37 |
|
38 |
|
39 .SH EXAMPLES |
|
40 .SH Import from a remote location |
|
41 .PP |
|
42 .RS |
|
43 |
|
44 .nf |
|
45 # docker import http://example.com/exampleimage.tgz example/imagerepo |
|
46 |
|
47 .fi |
|
48 .RE |
|
49 |
|
50 .SH Import from a local file |
|
51 .PP |
|
52 Import to docker via pipe and stdin: |
|
53 |
|
54 .PP |
|
55 .RS |
|
56 |
|
57 .nf |
|
58 # cat exampleimage.tgz | docker import \- example/imagelocal |
|
59 |
|
60 .fi |
|
61 .RE |
|
62 |
|
63 .PP |
|
64 Import with a commit message |
|
65 |
|
66 .PP |
|
67 .RS |
|
68 |
|
69 .nf |
|
70 # cat exampleimage.tgz | docker import \-\-message "New image imported from tarball" \- exampleimagelocal:new |
|
71 |
|
72 .fi |
|
73 .RE |
|
74 |
|
75 .PP |
|
76 Import to a Docker image from a local file. |
|
77 |
|
78 .PP |
|
79 .RS |
|
80 |
|
81 .nf |
|
82 # docker import /path/to/exampleimage.tgz |
|
83 |
|
84 .fi |
|
85 .RE |
|
86 |
|
87 .SH Import from a local file and tag |
|
88 .PP |
|
89 Import to docker via pipe and stdin: |
|
90 |
|
91 .PP |
|
92 .RS |
|
93 |
|
94 .nf |
|
95 # cat exampleimageV2.tgz | docker import \- example/imagelocal:V\-2.0 |
|
96 |
|
97 .fi |
|
98 .RE |
|
99 |
|
100 .SH Import from a local directory |
|
101 .PP |
|
102 .RS |
|
103 |
|
104 .nf |
|
105 # tar \-c . | docker import \- exampleimagedir |
|
106 |
|
107 .fi |
|
108 .RE |
|
109 |
|
110 .SH Apply specified Dockerfile instructions while importing the image |
|
111 .PP |
|
112 This example sets the docker image ENV variable DEBUG to true by default. |
|
113 |
|
114 .PP |
|
115 .RS |
|
116 |
|
117 .nf |
|
118 # tar \-c . | docker import \-c="ENV DEBUG true" \- exampleimagedir |
|
119 |
|
120 .fi |
|
121 .RE |
|
122 |
|
123 |
|
124 .SH See also |
|
125 .PP |
|
126 \fBdocker\-export(1)\fP to export the contents of a filesystem as a tar archive to STDOUT. |
|
127 |
|
128 |
|
129 .SH HISTORY |
|
130 .PP |
|
131 April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
|
132 based on docker.com source material and internal work. |
|
133 June 2014, updated by Sven Dowideit |
|
134 \[la][email protected]\[ra] |