You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also address most troff issues. Not all of them are easy, in particular those
manpages with long urls and examples that include digests are difficult to
render in traditional manpages.
Add troff renderering to the Manpage to surface those troff issues more easily
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Copy file name to clipboardExpand all lines: common/docs/Containerfile.5.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,23 +117,23 @@ Current supported mount TYPES are bind, cache, secret and tmpfs.
117
117
118
118
Common Options:
119
119
120
-
· src, source: mount source spec for bind and volume. Mandatory for bind. If `from` is specified, `src` is the subpath in the `from` field.
120
+
* src, source: mount source spec for bind and volume. Mandatory for bind. If `from` is specified, `src` is the subpath in the `from` field.
121
121
122
-
· dst, destination, target: mount destination spec.
122
+
* dst, destination, target: mount destination spec.
123
123
124
-
· ro, read-only: true (default) or false.
124
+
* ro, read-only: true (default) or false.
125
125
126
126
Options specific to bind:
127
127
128
-
· bind-propagation: shared, slave, private, rshared, rslave, or rprivate(default). See also mount(2).
128
+
* bind-propagation: shared, slave, private, rshared, rslave, or rprivate(default). See also mount(2).
129
129
130
-
. bind-nonrecursive: do not setup a recursive bind mount. By default it is recursive.
130
+
* bind-nonrecursive: do not setup a recursive bind mount. By default it is recursive.
131
131
132
-
· from: stage or image name for the root of the source. Defaults to the build context.
132
+
* from: stage or image name for the root of the source. Defaults to the build context.
133
133
134
-
· relabel=shared, z: Relabels src content with a shared label.
134
+
* relabel=shared, z: Relabels src content with a shared label.
135
135
136
-
. relabel=private, Z: Relabels src content with a private label.
136
+
* relabel=private, Z: Relabels src content with a private label.
137
137
138
138
Labeling systems like SELinux require proper labels on the bind mounted content mounted into a container. Without a label, the security system might prevent the processes running in side the container from using the content. By default, container engines do not change the labels set by the OS. The relabel flag tells the engine to relabel file objects on the shared mountz.
139
139
@@ -143,31 +143,31 @@ Current supported mount TYPES are bind, cache, secret and tmpfs.
143
143
144
144
Relabeling walks the file system under the mount and changes the label on each file, if the mount has thousands of inodes, this process takes a long time, delaying the start of the container.
145
145
146
-
· rw, read-write: allows writes on the mount.
146
+
* rw, read-write: allows writes on the mount.
147
147
148
148
Options specific to tmpfs:
149
149
150
-
· tmpfs-size: Size of the tmpfs mount in bytes. Unlimited by default in Linux.
150
+
* tmpfs-size: Size of the tmpfs mount in bytes. Unlimited by default in Linux.
151
151
152
-
· tmpfs-mode: File mode of the tmpfs in octal. (e.g. 700 or 0700.) Defaults to 1777 in Linux.
152
+
* tmpfs-mode: File mode of the tmpfs in octal. (e.g. 700 or 0700.) Defaults to 1777 in Linux.
153
153
154
-
· tmpcopyup: Path that is shadowed by the tmpfs mount is recursively copied up to the tmpfs itself.
154
+
* tmpcopyup: Path that is shadowed by the tmpfs mount is recursively copied up to the tmpfs itself.
155
155
156
156
Options specific to cache:
157
157
158
-
· id: Create a separate cache directory for a particular id.
158
+
* id: Create a separate cache directory for a particular id.
159
159
160
-
· mode: File mode for new cache directory in octal. Default 0755.
160
+
* mode: File mode for new cache directory in octal. Default 0755.
161
161
162
-
· ro, readonly: read only cache if set.
162
+
* ro, readonly: read only cache if set.
163
163
164
-
· uid: uid for cache directory.
164
+
* uid: uid for cache directory.
165
165
166
-
· gid: gid for cache directory.
166
+
* gid: gid for cache directory.
167
167
168
-
· from: stage name for the root of the source. Defaults to host cache directory.
168
+
* from: stage name for the root of the source. Defaults to host cache directory.
Copy file name to clipboardExpand all lines: common/docs/containerignore.5.md
+47-27Lines changed: 47 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,23 +6,27 @@
6
6
7
7
# INTRODUCTION
8
8
9
-
Before container engines build an image, they look for a file named .containerignore or .dockerignore in the root
10
-
context directory. If one of these file exists, the CLI modifies the context to exclude files and
11
-
directories that match patterns specified in the file. This avoids adding them to images using the ADD or COPY
12
-
instruction.
13
-
14
-
The CLI interprets the .containerignore or .dockerignore file as a newline-separated list of patterns similar to
15
-
the file globs of Unix shells. For the purposes of matching, the root of the context is considered to be both the
16
-
working and the root directory. For example, the patterns /foo/bar and foo/bar both exclude a file or directory
17
-
named bar in the foo subdirectory of PATH or in the root of the git repository located at URL. Neither excludes
9
+
Before container engines build an image, they look for a file named
10
+
`.containerignore` or `.dockerignore` in the root context directory. If one of
11
+
these file exists, the CLI modifies the context to exclude files and
12
+
directories that match patterns specified in the file. This avoids adding them
13
+
to images using the ADD or COPY instruction.
14
+
15
+
The CLI interprets the `.containerignore` or `.dockerignore` file as a
16
+
newline-separated list of patterns similar to the file globs of Unix
17
+
shells. For the purposes of matching, the root of the context is considered to
18
+
be both the working and the root directory. For example, the patterns `/foo/bar`
19
+
and `foo/bar` both exclude a file or directory named bar in the foo subdirectory
20
+
of PATH or in the root of the git repository located at URL. Neither excludes
18
21
anything else.
19
22
20
-
If a line in .containerignore or .dockerignore file starts with # in column 1, then this line is considered as a
21
-
comment and is ignored before interpreted by the CLI.
23
+
If a line in `.containerignore` or `.dockerignore` file starts with `#` in
24
+
column 1, then this line is considered as a comment and is ignored before
25
+
interpreted by the CLI.
22
26
23
27
# EXAMPLES
24
28
25
-
Here is an example .containerignore file:
29
+
Here is an example `.containerignore` file:
26
30
27
31
```
28
32
# comment
@@ -33,6 +37,7 @@ temp?
33
37
34
38
This file causes the following build behavior:
35
39
Rule Behavior
40
+
36
41
```
37
42
# comment Ignored.
38
43
*/temp* Exclude files and directories whose names start with temp in any immediate subdirectory of the root.
@@ -41,22 +46,33 @@ For example, the plain file /somedir/temporary.txt is excluded, as is the direct
41
46
root. For example, /somedir/subdir/temporary.txt is excluded.
42
47
temp? Exclude files and directories in the root directory whose names are a one-character extension of temp. For example, /tempa and /tempb are excluded.
43
48
```
44
-
Matching is done using Go’s filepath.Match rules. A preprocessing step removes leading and trailing whitespace and
45
-
eliminates . and .. elements using Go’s filepath.Clean. Lines that are blank after preprocessing are ignored.
46
49
47
-
Beyond Go’s filepath.Match rules, Docker also supports a special wildcard string ** that matches any number of
48
-
directories (including zero). For example, **/*.go will exclude all files that end with .go that are found in all
49
-
directories, including the root of the build context.
50
+
Matching is done using the golang `path/filepath` package.
51
+
52
+
Match rules:
53
+
* A preprocessing step removes leading and trailing whitespace and eliminates
54
+
. and .. elements using the golang `path/filepath` package.
55
+
* Lines that are blank after preprocessing are ignored.
56
+
57
+
Beyond the `filepath.Match` rules, Docker also supports a special wildcard
58
+
string `**` that matches any number of directories (including zero). For
59
+
example, `**/*.go` will exclude all files that end with `.go` that are found in
60
+
all directories, including the root of the build context.
61
+
62
+
Lines starting with `!` (exclamation mark) can be used to make exceptions to
63
+
exclusions. The following is an example .containerignore file that uses this
64
+
mechanism:
50
65
51
-
Lines starting with ! (exclamation mark) can be used to make exceptions to exclusions. The following is an example .containerignore file that uses this mechanism:
52
66
```
53
67
*.md
54
68
!README.md
55
69
```
56
70
All markdown files except README.md are excluded from the context.
57
71
58
-
The placement of ! exception rules influences the behavior: the last line of the .containerignore that matches a
59
-
particular file determines whether it is included or excluded. Consider the following example:
72
+
The placement of `!` exception rules influences the behavior: the last line of
73
+
the `.containerignore` that matches a particular file determines whether it is
74
+
included or excluded. Consider the following example:
75
+
60
76
```
61
77
*.md
62
78
!README*.md
@@ -65,20 +81,24 @@ README-secret.md
65
81
No markdown files are included in the context except README files other than README-secret.md.
66
82
67
83
Now consider this example:
84
+
68
85
```
69
86
*.md
70
87
README-secret.md
71
88
!README*.md
72
89
```
73
-
All of the README files are included. The middle line has no effect because !README*.md matches README-secret.md and
74
-
comes last.
75
90
76
-
You can even use the .containerignore file to exclude the Containerfile or Dockerfile and .containerignore files.
77
-
These files are still sent to the daemon because it needs them to do its job. But the ADD and COPY instructions do
78
-
not copy them to the image.
91
+
All of the README files are included. The middle line has no effect because
92
+
`!README*.md` matches `README-secret.md` and comes last.
93
+
94
+
You can even use the .containerignore file to exclude the `Containerfile` or
95
+
`Dockerfile` and `.containerignore` files. These files are still sent to the
96
+
daemon because it needs them to do its job. But the `ADD` and `COPY` instructions
97
+
do not copy them to the image.
79
98
80
-
Finally, you may want to specify which files to include in the context, rather than which to exclude. To achieve
81
-
this, specify * as the first pattern, followed by one or more ! exception patterns.
99
+
Finally, you may want to specify which files to include in the context, rather
100
+
than which to exclude. To achieve this, specify `*` as the first pattern,
0 commit comments