Skip to content

Commit ecaca2d

Browse files
committed
Cleanup manpage formatting
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>
1 parent 46ca9db commit ecaca2d

File tree

4 files changed

+153
-95
lines changed

4 files changed

+153
-95
lines changed

common/docs/Containerfile.5.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,23 @@ Current supported mount TYPES are bind, cache, secret and tmpfs.
117117

118118
Common Options:
119119

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.
121121

122-
· dst, destination, target: mount destination spec.
122+
* dst, destination, target: mount destination spec.
123123

124-
· ro, read-only: true (default) or false.
124+
* ro, read-only: true (default) or false.
125125

126126
Options specific to bind:
127127

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).
129129

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.
131131

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.
133133

134-
· relabel=shared, z: Relabels src content with a shared label.
134+
* relabel=shared, z: Relabels src content with a shared label.
135135

136-
. relabel=private, Z: Relabels src content with a private label.
136+
* relabel=private, Z: Relabels src content with a private label.
137137

138138
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.
139139

@@ -143,31 +143,31 @@ Current supported mount TYPES are bind, cache, secret and tmpfs.
143143

144144
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.
145145

146-
· rw, read-write: allows writes on the mount.
146+
* rw, read-write: allows writes on the mount.
147147

148148
Options specific to tmpfs:
149149

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.
151151

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.
153153

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.
155155

156156
Options specific to cache:
157157

158-
· id: Create a separate cache directory for a particular id.
158+
* id: Create a separate cache directory for a particular id.
159159

160-
· mode: File mode for new cache directory in octal. Default 0755.
160+
* mode: File mode for new cache directory in octal. Default 0755.
161161

162-
· ro, readonly: read only cache if set.
162+
* ro, readonly: read only cache if set.
163163

164-
· uid: uid for cache directory.
164+
* uid: uid for cache directory.
165165

166-
· gid: gid for cache directory.
166+
* gid: gid for cache directory.
167167

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.
169169

170-
· rw, read-write: allows writes on the mount.
170+
* rw, read-write: allows writes on the mount.
171171

172172
**RUN --network**
173173

common/docs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ docs: $(patsubst %.md,%,$(wildcard *.md))
77

88
%.5: %.5.md
99
$(GOMD2MAN) -in $^ -out $@
10+
groff -Tascii $@ > /dev/null
1011

1112
.PHONY: install
1213
install:

common/docs/containerignore.5.md

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,27 @@
66

77
# INTRODUCTION
88

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
1821
anything else.
1922

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.
2226

2327
# EXAMPLES
2428

25-
Here is an example .containerignore file:
29+
Here is an example `.containerignore` file:
2630

2731
```
2832
# comment
@@ -33,6 +37,7 @@ temp?
3337

3438
This file causes the following build behavior:
3539
Rule Behavior
40+
3641
```
3742
# comment Ignored.
3843
*/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
4146
root. For example, /somedir/subdir/temporary.txt is excluded.
4247
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.
4348
```
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.
4649

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:
5065

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:
5266
```
5367
*.md
5468
!README.md
5569
```
5670
All markdown files except README.md are excluded from the context.
5771

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+
6076
```
6177
*.md
6278
!README*.md
@@ -65,20 +81,24 @@ README-secret.md
6581
No markdown files are included in the context except README files other than README-secret.md.
6682

6783
Now consider this example:
84+
6885
```
6986
*.md
7087
README-secret.md
7188
!README*.md
7289
```
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.
7590

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.
7998

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,
101+
followed by one or more `!` exception patterns.
82102

83103
## SEE ALSO
84104
buildah-build(1), podman-build(1), docker-build(1)

0 commit comments

Comments
 (0)