1buildah-copy(1) General Commands Manual buildah-copy(1)
2
3
4
6 buildah-copy - Copies the contents of a file, URL, or directory into a
7 container's working directory.
8
9
11 buildah copy container src [[src ...] dest]
12
13
15 Copies the contents of a file, URL, or a directory to a container's
16 working directory or a specified location in the container. If a local
17 directory is specified as a source, its contents are copied to the des‐
18 tination.
19
20
22 --add-history
23
24
25 Add an entry to the history which will note the digest of the added
26 content. Defaults to false.
27
28
29 Note: You can also override the default value of --add-history by set‐
30 ting the BUILDAH_HISTORY environment variable. export BUILDAH_HIS‐
31 TORY=true
32
33
34 --chown owner:group
35
36
37 Sets the user and group ownership of the destination content.
38
39
40 --contextdir
41
42
43 Build context directory. Specifying a context directory causes Buildah
44 to chroot into a the context directory. This means copying files
45 pointed at by symbolic links outside of the chroot will fail.
46
47
48 --ignorefile
49
50
51 Path to an alternative .dockerignore file. Requires --contextdir be
52 specified.
53
54
55 --quiet, -q
56
57
58 Refrain from printing a digest of the copied content.
59
60
62 buildah copy containerID '/myapp/app.conf' '/myapp/app.conf'
63
64
65 buildah copy --chown myuser:mygroup containerID '/myapp/app.conf'
66 '/myapp/app.conf'
67
68
69 buildah copy containerID '/home/myuser/myproject.go'
70
71
72 buildah copy containerID '/home/myuser/myfiles.tar' '/tmp'
73
74
75 buildah copy containerID '/tmp/workingdir' '/tmp/workingdir'
76
77
78 buildah copy containerID 'https://github.com/containers/buildah' '/tmp'
79
80
81 buildah copy containerID 'passwd' 'certs.d' /etc
82
83
85 .dockerignore
86 When the \fB\fC--ignorefile\fR option is specified Buildah reads the
87 content to exclude files and directories from the source directory,
88 when copying content into the image.
89
90
91 Users can specify a series of Unix shell globals in a ignore file to
92 identify files/directories to exclude.
93
94
95 Buildah supports a special wildcard string ** which matches any number
96 of directories (including zero). For example, */.go will exclude all
97 files that end with .go that are found in all directories.
98
99
100 Example .dockerignore file:
101
102
103 # here are files we want to exclude
104 */*.c
105 **/output*
106 src
107
108
109
110 */*.c Excludes files and directories whose names ends with .c in any
111 top level subdirectory. For example, the source file include/root‐
112 less.c.
113
114
115 **/output* Excludes files and directories starting with output from any
116 directory.
117
118
119 src Excludes files named src and the directory src as well as any con‐
120 tent in it.
121
122
123 Lines starting with ! (exclamation mark) can be used to make exceptions
124 to exclusions. The following is an example .dockerignore file that uses
125 this mechanism:
126
127
128 *.doc
129 !Help.doc
130
131
132
133 Exclude all doc files except Help.doc from the image.
134
135
136 This functionality is compatible with the handling of .dockerignore
137 files described here:
138
139
140 https://docs.docker.com/engine/reference/builder/#dockerignore-file
141
142
144 buildah(1)
145
146
147
148buildah March 2017 buildah-copy(1)