Skip to content

Commit 8f183b5

Browse files
committed
Add basic manpages for ctr, containerd, containerd-config
Adds initial manpages for ctr, containerd, and containerd config commands, as well as the config.toml configuration file. Adds targets to Makefile for generating and installing manpages. Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
1 parent fc1913a commit 8f183b5

File tree

6 files changed

+330
-4
lines changed

6 files changed

+330
-4
lines changed

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ TEST_REQUIRES_ROOT_PACKAGES=$(filter \
5757

5858
# Project binaries.
5959
COMMANDS=ctr containerd containerd-stress containerd-release
60-
MANPAGES=ctr.1 containerd.1 config.toml.5 containerd-config.1 containerd-publish.1
60+
MANPAGES=ctr.1 containerd.1 config.toml.5 containerd-config.1
6161

6262
GO_TAGS=$(if $(BUILDTAGS),-tags "$(BUILDTAGS)",)
6363
GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG) $(EXTRA_LDFLAGS)'
@@ -83,7 +83,7 @@ BINARIES=$(addprefix bin/,$(COMMANDS))
8383
TESTFLAGS ?= -v $(TESTFLAGS_RACE)
8484
TESTFLAGS_PARALLEL ?= 8
8585

86-
.PHONY: clean all AUTHORS build binaries test integration generate protos checkprotos coverage ci check help install uninstall vendor release
86+
.PHONY: clean all AUTHORS build binaries test integration generate protos checkprotos coverage ci check help install uninstall vendor release mandir install-man
8787
.DEFAULT: default
8888

8989
all: binaries
@@ -158,7 +158,7 @@ bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a sta
158158
binaries: $(BINARIES) ## build binaries
159159
@echo "$(WHALE) $@"
160160

161-
manpages: mandir $(addprefix man/,$(MANPAGES))
161+
man: mandir $(addprefix man/,$(MANPAGES))
162162
@echo "$(WHALE) $@"
163163

164164
mandir:
@@ -168,6 +168,15 @@ man/%: docs/man/%.md FORCE
168168
@echo "$(WHALE) $<"
169169
go-md2man -in "$<" -out "$@"
170170

171+
define installmanpage
172+
mkdir -p $(DESTDIR)/man/man$(2);
173+
gzip -c $(1) >$(DESTDIR)/man/man$(2)/$(3).gz;
174+
endef
175+
176+
install-man:
177+
@echo "$(WHALE) $@"
178+
$(foreach manpage,$(addprefix man/,$(MANPAGES)), $(call installmanpage,$(manpage),$(subst .,,$(suffix $(manpage))),$(notdir $(manpage))))
179+
171180
release: $(BINARIES)
172181
@echo "$(WHALE) $@"
173182
@rm -rf releases/$(RELEASE) releases/$(RELEASE).tar.gz

docs/man/config.toml.5.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# config.toml 5 02/02/2018
2+
3+
## SYNOPSIS
4+
5+
The **config.toml** file is a configuration file for the containerd daemon. The
6+
file must be placed in **/etc/containerd/** or used with the **--config**
7+
option of **containerd** to be used by the daemon. If the file does not exist
8+
at the appropriate location or is not provided via the **--config** option
9+
containerd uses its default configuration settings, which can be displayed
10+
with the **containerd config(1)** command.
11+
12+
## DESCRIPTION
13+
14+
The TOML file used to configure the containerd daemon settings has a short
15+
list of global settings followed by a series of sections for specific areas
16+
of daemon configuration. There is also a section for **plugins** that allows
17+
each containerd plugin to have an area for plugin-specific configuration and
18+
settings.
19+
20+
## FORMAT
21+
22+
**root**
23+
: The root directory for containerd metadata. (Default: "/var/lib/containerd")
24+
25+
**state**
26+
: The state directory for containerd (Default: "/run/containerd")
27+
28+
**oom_score**
29+
: The out of memory (OOM) score applied to the containerd daemon process (Default: 0)
30+
31+
**[grpc]**
32+
: Section for gRPC socket listener settings. Contains three properties:
33+
- **address** (Default: "/run/containerd/containerd.sock")
34+
- **uid** (Default: 0)
35+
- **gid** (Default: 0)
36+
37+
**[debug]**
38+
: Section to enable and configure a debug socket listener. Contains four properties:
39+
- **address** (Default: "/run/containerd/debug.sock")
40+
- **uid** (Default: 0)
41+
- **gid** (Default: 0)
42+
- **level** (Default: "info") sets the debug log level
43+
44+
**[metrics]**
45+
: Section to enable and configure a metrics listener. Contains two properties:
46+
- **address** (Default: "") Metrics endpoint does not listen by default
47+
- **grpc_histogram** (Default: false) Turn on or off gRPC histogram metrics
48+
49+
**[cgroup]**
50+
: Section for Linux cgroup specific settings
51+
- **path** (Default: "") Specify a custom cgroup path for created containers
52+
53+
**[plugins]**
54+
: The plugins section contains configuration options exposed from installed plugins.
55+
The following plugins are enabled by default and their settings are shown below.
56+
Plugins that are not enabled by default will provide their own configuration values
57+
documentation.
58+
- **[plugins.cgroup]** has one option __no_prometheus__ (Default: **false**)
59+
- **[plugins.diff]** has one option __default__, a list by default set to **["walking"]**
60+
- **[plugins.linux]** has several options for configuring the runtime, shim, and related options:
61+
**shim** specifies the shim binary (Default: **"containerd-shim"**),
62+
**runtime** is the OCI compliant runtime binary (Default: **"runc"**),
63+
**runtime_root** is the root directory used by the runtime (Default: **""**),
64+
**no_shim** specifies whether to use a shim or not (Default: **false**),
65+
**shim_debug** turns on debugging for the shim (Default: **false**)
66+
- **[plugins.scheduler]** has several options that perform advanced tuning for the scheduler:
67+
**pause_threshold** is the maximum amount of time GC should be scheduled (Default: **0.02**),
68+
**deletion_threshold** guarantees GC is scheduled after n number of deletions (Default: **0** [not triggered]),
69+
**mutation_threshold** guarantees GC is scheduled after n number of database mutations (Default: **100**),
70+
**schedule_delay** defines the delay after trigger event before scheduling a GC (Default **"0ms"** [immediate]),
71+
**startup_delay** defines the delay after startup before scheduling a GC (Default **"100ms"**)
72+
73+
## EXAMPLE
74+
75+
The following is a complete **config.toml** default configuration example:
76+
77+
```
78+
root = "/var/lib/containerd"
79+
state = "/run/containerd"
80+
oom_score = 0
81+
82+
[grpc]
83+
address = "/run/containerd/containerd.sock"
84+
uid = 0
85+
gid = 0
86+
87+
[debug]
88+
address = "/run/containerd/debug.sock"
89+
uid = 0
90+
gid = 0
91+
level = "info"
92+
93+
[metrics]
94+
address = ""
95+
grpc_histogram = false
96+
97+
[cgroup]
98+
path = ""
99+
100+
[plugins]
101+
[plugins.cgroups]
102+
no_prometheus = false
103+
[plugins.diff]
104+
default = ["walking"]
105+
[plugins.linux]
106+
shim = "containerd-shim"
107+
runtime = "runc"
108+
runtime_root = ""
109+
no_shim = false
110+
shim_debug = false
111+
[plugins.scheduler]
112+
pause_threshold = 0.02
113+
deletion_threshold = 0
114+
mutation_threshold = 100
115+
schedule_delay = 0
116+
startup_delay = 100000000
117+
```
118+
119+
## BUGS
120+
121+
Please file any specific issues that you encounter at
122+
https://github.com/containerd/containerd.
123+
124+
## AUTHOR
125+
126+
Phil Estes <estesp@gmail.com>
127+
128+
## SEE ALSO
129+
130+
ctr(1), containerd-config(1), containerd(1)

docs/man/containerd-config.1.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# containerd-config 1 01/30/2018
2+
3+
## SYNOPSIS
4+
5+
containerd config [command]
6+
7+
## DESCRIPTION
8+
9+
The *containerd config* command has one subcommand, named *default*, which
10+
will display on standard output the default containerd config for this version
11+
of the containerd daemon.
12+
13+
This output can be piped to a __config.toml(5)__ file and placed in
14+
**/etc/containerd** to be used as the configuration for containerd on daemon
15+
startup. The configuration can be placed in any filesystem location and used
16+
with the **--config** option to the containerd daemon as well.
17+
18+
See __config.toml(5)__ for more information on the containerd configuration
19+
options.
20+
21+
## OPTIONS
22+
23+
**default**
24+
: This subcommand will output the TOML formatted containerd configuration to standard output
25+
26+
## BUGS
27+
28+
Please file any specific issues that you encounter at
29+
https://github.com/containerd/containerd.
30+
31+
## AUTHOR
32+
33+
Phil Estes <estesp@gmail.com>
34+
35+
## SEE ALSO
36+
37+
ctr(1), config.toml(5), containerd(1)

docs/man/containerd.1.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# containerd 1 01/29/2018
2+
3+
## SYNOPSIS
4+
5+
containerd [global options] command [command options] [arguments...]
6+
7+
## DESCRIPTION
8+
9+
**containerd** is a high performance container runtime whose daemon can be started
10+
by using this command. If none of the *config*, *publish*, or *help* commands
11+
are specified the default action of the **containerd** command is to start the
12+
containerd daemon in the foreground.
13+
14+
A default configuration is used if no TOML configuration is specified or located
15+
at the default file location. The *containerd config* command can be used to
16+
generate the default configuration for containerd. The output of that command
17+
can be used and modified as necessary as a custom configuration.
18+
19+
The *publish* command is used internally by parts of the containerd runtime
20+
to publish events. It is not meant to be used as a standalone utility.
21+
22+
## OPTIONS
23+
24+
**--config value, -c value**
25+
: Specify the default path to the configuration file (default: "/etc/containerd/config.toml")
26+
27+
**--log-level value, -l value**
28+
: Set the logging level. Available levels are: [debug, info, warn, error, fatal, panic]
29+
30+
**--address value, -a value**
31+
: UNIX socket address for containerd's GRPC server to listen on (default: "/run/containerd/containerd.sock")
32+
33+
**--root value**
34+
: The containerd root directory (default: "/var/lib/containerd"). A persistent directory location where metadata and image content are stored
35+
36+
**--state value**
37+
: The containerd state directory (default: "/run/containerd"). A transient state directory used during containerd operation
38+
39+
**--help, -h**
40+
: Show containerd command help text
41+
42+
**--version, -v**
43+
: Print the containerd server version
44+
45+
## BUGS
46+
47+
Please file any specific issues that you encounter at
48+
https://github.com/containerd/containerd.
49+
50+
## AUTHOR
51+
52+
Phil Estes <estesp@gmail.com>
53+
54+
## SEE ALSO
55+
56+
ctr(1), config.toml(5), containerd-config(1)

docs/man/ctr.1.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# ctr 1 01/30/2018
2+
3+
## SYNOPSIS
4+
5+
**ctr [global options] command [command options] [arguments...]**
6+
7+
## DESCRIPTION
8+
9+
**ctr** is an unsupported debug and administrative client for interacting
10+
with the containerd daemon. Because it is unsupported, the commands,
11+
options, and operation are not guaranteed to be backward compatible or
12+
stable from release to release of the containerd project.
13+
14+
## OPTIONS
15+
16+
The following commands are available in the **ctr** utility:
17+
18+
**plugins,plugin**
19+
: Provides information about containerd plugins
20+
21+
**version**
22+
: Prints the client and server versions
23+
24+
**containers,c,container**
25+
: Manages and interacts with containers
26+
27+
**content**
28+
: Manages and interacts with content
29+
30+
**events,event**
31+
: Displays containerd events
32+
33+
**images,image**
34+
: Manages and interacts with images
35+
36+
**namespaces,namespace**
37+
: Manages and interacts with containerd namespaces
38+
39+
**pprof**
40+
: Provides golang pprof outputs for containerd
41+
42+
**run**
43+
: Runs a container
44+
45+
**snapshots,snapshot**
46+
: Manages and interacts with snapshots
47+
48+
**tasks,t,task**
49+
: Manages and interacts with tasks
50+
51+
**shim**
52+
: Interacts with a containerd shim directly
53+
54+
**help,h**
55+
: Displays a list of commands or help for one specific command
56+
57+
The following global options apply to all **ctr** commands:
58+
59+
**--debug**
60+
: Enable debug output in logs
61+
62+
**--address value, -a value**
63+
: Address for containerd's GRPC server (default: */run/containerd/containerd.sock*)
64+
65+
**--timeout value**
66+
: Total timeout for ctr commands (default: *0s*)
67+
68+
**--connect-timeout value**
69+
: Timeout for connecting to containerd (default: *0s*)
70+
71+
**--namespace value, -n value**
72+
: Namespace to use with commands (default: *default*) [also read from *$CONTAINERD_NAMESPACE*]
73+
74+
**--help, -h**
75+
: Show help text
76+
77+
**--version, -v**
78+
: Prints the **ctr** version
79+
80+
## BUGS
81+
82+
Note that the **ctr** utility is not an officially supported part of the
83+
containerd project releases.
84+
85+
However, please feel free to file any specific issues that you encounter at
86+
https://github.com/containerd/containerd.
87+
88+
## AUTHOR
89+
90+
Phil Estes <estesp@gmail.com>
91+
92+
## SEE ALSO
93+
94+
containerd(1), config.toml(5), containerd-config(1)

script/setup/install-dev-tools

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ go get -u github.com/stevvooe/protobuild
88
go get -u github.com/alecthomas/gometalinter
99
gometalinter --install >/dev/null
1010
go get -u github.com/LK4D4/vndr
11-
go get -u github.com/estesp/go-md2man
11+
go get -u github.com/cpuguy83/go-md2man

0 commit comments

Comments
 (0)