Skip to content

Commit ea452d7

Browse files
committed
doc: Update to match current state & extend docs
- Update "See also" sections Toolbox does not use Buildah for a considerable time now[0]. We can stop referencing it in the "See also" sections of the documentation. In some places mention podman command man pages where they are relevant. - Add section about toolbox images/containers Toolbox only supports certain OCI images. These should be documented. Also, document the change of fedora-toolbox image name. - Add a section about toolbox container setup Toolbox containers are specifically configured OCI containers. This should be documented so that users know what they're using. - Remove redundant part documentation The description of what `toolbox init-container` does is already in toolbox-init-container(1). There's no need to have it in toolbox-create(1). Instead, replace the text with a hint to visit the other part of documentation. - Clarify behaviour of --image option The fact that Toolbox by default tries to pull from the Fedora registry[1] should be noted. - Update synopsis & description of commands Mention options passed to `podman exec`. Remove redundant paragraph about container names (is already dealt with in toolbox-create(1)). There's no need to mention the name of the default container on Fedora since Toolbox now also supports RHEL. Mention the default used image on unrecognised systems. Emphasize the fact that toolboxes are not a fully sandboxed environment. Update the wording of the description and splits it into a few subsections. The description of the --monitor-host was inaccurate and while the option will go away in the future[2], it is currently in and should be more documented. [0] #160 [1] https://registry.fedoraproject.org [2] #617 #512
1 parent 3db59ab commit ea452d7

9 files changed

Lines changed: 168 additions & 68 deletions

‎doc/toolbox-create.1.md‎

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,42 @@ the image had a tag, then the tag is included in the name of the container,
2626
but it's separated by a hyphen, not a colon. A different name can be assigned
2727
by using the CONTAINER argument.
2828

29+
If the host system is not recognized the used image will be `fedora-toolbox`.
30+
31+
Toolbox containers are primarily created in a way to be tightly integrated with
32+
the host system. They are not meant to be secure.
33+
2934
### Entry Point
3035

3136
A key feature of toolbox containers is their entry point, the `toolbox
3237
init-container` command.
3338

34-
OCI containers are inherently immutable. Configuration options passed through
35-
`podman create` are baked into the definition of the OCI container, and can't
36-
be changed later. This means that changes and improvements made in newer
37-
versions of Toolbox can't be applied to pre-existing toolbox containers
38-
created by older versions of Toolbox. This is avoided by using the entry point
39-
to configure the container at runtime.
40-
41-
The entry point of a toolbox container customizes the container to fit the
42-
current user by ensuring that it has a user that matches the one on the host.
43-
It ensures that configuration files, such as `/etc/host.conf`, `/etc/hosts`,
44-
`/etc/localtime`, `/etc/resolv.conf` and `/etc/timezone`, inside the container
45-
are kept synchronized with the host. The entry point also bind mounts various
46-
subsets of the host's filesystem hierarchy to their corresponding locations
47-
inside the container to provide seamless integration with the host. This
48-
includes `/run/libvirt`, `/run/systemd/journal`, `/run/udev/data`,
49-
`/var/lib/libvirt`, `/var/lib/systemd/coredump`, `/var/log/journal` and others.
50-
51-
On some host operating systems, important paths like `/home`, `/media` or
52-
`/mnt` are symbolic links to other locations. The entry point ensures that
53-
paths inside the container match those on the host, to avoid needless
54-
confusion.
39+
Read more about the entry-point in `toolbox-init-container(1)`.
5540

56-
## OPTIONS ##
41+
### Toolbox setup
42+
43+
`toolbox-create(1)` passes several options to `podman-create(1)` when creating
44+
toolbox containers to provide the needed functionality. The options have the
45+
following effects:
46+
47+
- Toolboxes share with the host system:
48+
- network stack, including dns
49+
- IPC (shared memory, semaphores, message queues,..)
50+
- PID namespace
51+
- ulimits
52+
- Toolboxes have access to cherry-picked parts of host filesystem made
53+
available under /run/host/
54+
- Toolboxes are privileged containers
55+
- SELinux label separation is disabled for toolboxes
56+
- Toolboxes use as their entry-point `toolbox-init-container(1)`
5757

58-
The following options are understood:
58+
Despite being privileged, rootless containers cannot have more privileges than
59+
the user that created them.
60+
61+
Thanks to these options, `toolbox-init-container(1)` can futher set up the
62+
containers. Read more about the entry-point in `toolbox-init-container(1)`.
63+
64+
## OPTIONS ##
5965

6066
**--distro** DISTRO, **-d** DISTRO
6167

@@ -68,6 +74,9 @@ Change the NAME of the base image used to create the toolbox container. This
6874
is useful for creating containers from custom-built base images. Cannot be used
6975
used with `--release`.
7076

77+
If NAME does not contain a domain, the image will be pulled from
78+
`registry.fedoraproject.org`.
79+
7180
**--release** RELEASE, **-r** RELEASE
7281

7382
Create a toolbox container for a different operating system RELEASE than the
@@ -95,4 +104,4 @@ $ toolbox create --image bar foo
95104

96105
## SEE ALSO
97106

98-
`buildah(1)`, `podman(1)`
107+
`toolbox(1)`, `toolbox-init-container(1)`, `podman(1)`, `podman-create(1)`

‎doc/toolbox-enter.1.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ if it's not available inside the container then it falls back to `/bin/bash`.
1616

1717
When invoked without any options, `toolbox enter` will try to enter the default
1818
toolbox container for the host, or if there's only one container available then
19-
it will use it. On Fedora, the default container is known as
20-
`fedora-toolbox-N`, where N is the release of the host. If there aren't any
21-
containers, `toolbox enter` will offer to create the default one for you.
19+
it will use it. If there aren't any containers, `toolbox enter` will offer to
20+
create one for you.
2221

2322
A specific container can be selected using the CONTAINER argument.
2423

@@ -61,4 +60,5 @@ $ toolbox enter foo
6160

6261
## SEE ALSO
6362

64-
`buildah(1)`, `podman(1)`, `podman-exec(1)`, `podman-start(1)`
63+
`toolbox(1)`, `toolbox-run(1)`, `podman(1)`, `podman-exec(1)`,
64+
`podman-start(1)`

‎doc/toolbox-help.1.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ $ toolbox help
2929
```
3030
$ toolbox help create
3131
```
32+
33+
## SEE ALSO
34+
35+
`toolbox(1)`

‎doc/toolbox-init-container.1.md‎

Lines changed: 66 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ be used as the entry point for all toolbox containers, and must be run inside
2121
the container that's to be initialized. It is not expected to be directly
2222
invoked by humans, and cannot be used on the host.
2323

24-
A key feature of toolbox containers is their entry point, the `toolbox
25-
init-container` command.
24+
### Shortcoming of container configuration
2625

2726
OCI containers are inherently immutable. Configuration options passed through
2827
`podman create` are baked into the definition of the OCI container, and can't
@@ -31,21 +30,35 @@ versions of Toolbox can't be applied to pre-existing toolbox containers
3130
created by older versions of Toolbox. This is avoided by using the entry point
3231
to configure the container at runtime.
3332

33+
### Entry point utilization
34+
3435
The entry point of a toolbox container customizes the container to fit the
3536
current user by ensuring that it has a user that matches the one on the host.
36-
It ensures that configuration files, such as `/etc/host.conf`, `/etc/hosts`,
37+
The passwords of the current user and root in the container are deleted.
38+
39+
Crucial configuration files, such as `/etc/host.conf`, `/etc/hosts`,
3740
`/etc/localtime`, `/etc/resolv.conf` and `/etc/timezone`, inside the container
38-
are kept synchronized with the host. The entry point also bind mounts various
39-
subsets of the host's filesystem hierarchy to their corresponding locations
40-
inside the container to provide seamless integration with the host. This
41-
includes `/run/libvirt`, `/run/systemd/journal`, `/run/udev/data`,
42-
`/var/lib/libvirt`, `/var/lib/systemd/coredump`, `/var/log/journal` and others.
41+
are kept synchronized with the host. This is something not very common in
42+
classic containers where the configuration is permanently baked in.
43+
44+
The entry point also bind mounts various subsets of the host's filesystem
45+
hierarchy to their corresponding locations inside the container to provide
46+
seamless integration with the host. This includes `/run/libvirt`,
47+
`/run/systemd/journal`, `/run/udev/data`, `/var/lib/libvirt`,
48+
`/var/lib/systemd/coredump`, `/var/log/journal` and others.
4349

4450
On some host operating systems, important paths like `/home`, `/media` or
4551
`/mnt` are symbolic links to other locations. The entry point ensures that
4652
paths inside the container match those on the host, to avoid needless
4753
confusion.
4854

55+
If KCM is used as the default Kerberos credentials cache, it is also set up
56+
inside of a toolbox container.
57+
58+
To give users the ability to tell programatically if they are in a toolbox, the
59+
entry point creates `/run/.toolboxenv` which is an empty file analogous to
60+
`/run/.containerenv`.
61+
4962
## OPTIONS ##
5063

5164
The following options are understood:
@@ -57,7 +70,23 @@ container.
5770

5871
**--home** HOME
5972

60-
Create a user inside the toolbox container whose login directory is HOME.
73+
Create a user inside the toolbox container whose login directory is HOME. This
74+
option is required.
75+
76+
**--shell** SHELL
77+
78+
Create a user inside the toolbox container whose login shell is SHELL. This
79+
option is required.
80+
81+
**--uid** UID
82+
83+
Create a user inside the toolbox container whose numerical user ID is UID. This
84+
option is required.
85+
86+
**--user** USER
87+
88+
Create a user inside the toolbox container whose login name is LOGIN. This
89+
option is required.
6190

6291
**--home-link**
6392

@@ -74,21 +103,34 @@ Make `/mnt` a symbolic link to `/var/mnt`.
74103
**--monitor-host**
75104

76105
Ensure that certain configuration files inside the toolbox container are kept
77-
synchronized with their counterparts on the host. Currently, these files are
78-
`/etc/hosts` and `/etc/resolv.conf`.
79-
80-
**--shell** SHELL
81-
82-
Create a user inside the toolbox container whose login shell is SHELL.
83-
84-
**--uid** UID
85-
86-
Create a user inside the toolbox container whose numerical user ID is UID.
87-
88-
**--user** USER
89-
90-
Create a user inside the toolbox container whose login name is LOGIN.
106+
synchronized with their counterparts on the host.
107+
108+
The synchronized files are:
109+
110+
- `/etc/host.conf`
111+
- `/etc/hosts`
112+
- `/etc/localtime`
113+
- `/etc/resolv.conf`
114+
- `/etc/timezone`
115+
116+
The following paths are bind mounted to paths from the host's filesystem
117+
available in the container:
118+
119+
- `/etc/machine-id`
120+
- `/run/libvirt`
121+
- `/run/systemd/journal`
122+
- `/run/systemd/resolve`
123+
- `/run/udev/data`
124+
- `/tmp`
125+
- `/var/lib/flatpak`
126+
- `/var/lib/libvirt`
127+
- `/var/lib/systemd/coredump`
128+
- `/var/log/journal`
129+
- `/var/mnt`
130+
131+
If path `/sys/fs/selinux` is found in the container, path `/usr/share/empty` is
132+
bind-mounted to that location to suppress SELinux.
91133

92134
## SEE ALSO
93135

94-
`podman(1)`, `podman-create(1)`, `podman-start(1)`
136+
`toolbox(1)`, `podman(1)`, `podman-create(1)`, `podman-start(1)`

‎doc/toolbox-list.1.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ $ toolbox list --images
4545

4646
## SEE ALSO
4747

48-
`buildah(1)`, `podman(1)`
48+
`toolbox(1)`, `podman(1)`, `podman-ps(1)`, `podman-images(1)`

‎doc/toolbox-rm.1.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
toolbox\-rm - Remove one or more toolbox containers
55

66
## SYNOPSIS
7-
**toolbox rm** [*--all*] [*--force*] [*CONTAINER*...]
7+
**toolbox rm** [*--all* | *-a*] [*--force* | *-f*] [*CONTAINER*...]
88

99
## DESCRIPTION
1010

@@ -49,4 +49,4 @@ $ toolbox rm --all --force
4949

5050
## SEE ALSO
5151

52-
`buildah(1)`, `podman(1)`, `podman-rm(1)`
52+
`toolbox(1)`, `podman(1)`, `podman-rm(1)`

‎doc/toolbox-rmi.1.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
toolbox\-rmi - Remove one or more toolbox images
55

66
## SYNOPSIS
7-
**toolbox rmi** [*--all*] [*--force*] [*IMAGE*...]
7+
**toolbox rmi** [*--all* | *-a*] [*--force* | *-f*] [*IMAGE*...]
88

99
## DESCRIPTION
1010

@@ -49,4 +49,4 @@ $ toolbox rmi --all --force
4949

5050
## SEE ALSO
5151

52-
`buildah(1)`, `podman(1)`, `podman-rmi(1)`
52+
`toolbox(1)`, `podman(1)`, `podman-rmi(1)`

‎doc/toolbox-run.1.md‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ toolbox\-run - Run a command in an existing toolbox container
1313
Runs a command inside an existing toolbox container. The container should have
1414
been created using the `toolbox create` command.
1515

16+
`toolbox run` wraps around `podman exec` and by default passes several options
17+
to it. It allocates a tty, connects to stdin, runs the passed command as the
18+
current user in the current directory and shares common environmental
19+
variables.
20+
21+
The executed command is wrapped in `capsh` that gets rid of all extra
22+
capabilities that could negatively affect the experience.
23+
1624
A toolbox container is an OCI container. Therefore, `toolbox run` is analogous
1725
to a `podman start` followed by a `podman exec`.
1826

19-
By default, the toolbox containers are tagged with the version of the OS that
20-
corresponds to the content inside them. Their names are prefixed with the name
21-
of the base image and suffixed with the current user name.
22-
2327
## OPTIONS ##
2428

2529
The following options are understood:
@@ -62,4 +66,5 @@ $ toolbox run --container foo uptime
6266

6367
## SEE ALSO
6468

65-
`buildah(1)`, `podman(1)`, `podman-exec(1)`, `podman-start(1)`
69+
`toolbox(1)`, `podman(1)`, `podman-exec(1)`, `podman-start(1)`, `capsh(1)`,
70+
`sh(1)`

‎doc/toolbox.1.md‎

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
toolbox - Unprivileged development environment
55

66
## SYNOPSIS
7-
**toolbox** [*--verbose* | *-v*] *COMMAND* [*ARGS*]
7+
**toolbox** [*--assumeyes* | *-y*]
8+
[*--help* | *-h*]
9+
[*--log-level LEVEL*]
10+
[*--log-podman*]
11+
*COMMAND* [*ARGS*...]
812

913
## DESCRIPTION
1014

@@ -34,7 +38,7 @@ seamlessly integrates with the rest of the operating system by providing
3438
access to the user's home directory, the Wayland and X11 sockets, SSH agent,
3539
etc..
3640

37-
## OPTIONS ##
41+
## GLOBAL OPTIONS ##
3842

3943
The following options are understood:
4044

@@ -46,10 +50,15 @@ Automatically answer yes for all questions.
4650

4751
Print a synopsis of this manual and exit.
4852

49-
**--verbose, -v**
53+
**--log-level**=*level*
5054

51-
Print debug information including standard error stream of internal commands.
52-
Use `-vv` for more detail.
55+
Log messages above specified level: debug, info, warn, error, fatal or panic
56+
(default: error)
57+
58+
**--log-podman**
59+
60+
Show log messages of invocations of Podman based on the logging level specified
61+
by option **log-level**.
5362

5463
## COMMANDS
5564

@@ -87,6 +96,37 @@ Remove one or more toolbox images.
8796

8897
Run a command in an existing toolbox container.
8998

99+
## Toolbox images
100+
101+
Toolbox currently supports these images:
102+
103+
registry.fedoraproject.org/fedora-toolbox
104+
: default image on Fedora
105+
106+
registry.access.redhat.com/ubi8
107+
: default image on RHEL
108+
109+
Images in this list are tested to be working with Toolbox. Any other image may
110+
work as well, but it is not guaranteed.
111+
112+
### NOTE: Name change of default Fedora image
113+
114+
Since version 0.0.99.1 Toolbox started to use registry.fedoraproject.org/fedora-toolbox
115+
instead of registry.fedoraproject.org/f{version}/fedora-toolbox. The image is
116+
still the same, only the name has changed.
117+
118+
Existing containers are not affected by this change, only new ones.
119+
120+
## Toolbox containers
121+
122+
Information about how toolbox containers are created can be found in
123+
`toolbox-create(1)`.
124+
125+
Information about the entry-point of toolbox containers can be found in
126+
`toolbox-init-container(1)`.
127+
90128
## SEE ALSO
91129

92-
`buildah(1)`, `podman(1)`
130+
`podman(1)`, `toolbox-create(1)`, `toolbox-enter(1)`, `toolbox-run(1)`,
131+
`toolbox-init-container(1)`, `toolbox-list(1)`, `toolbox-rm(1)`,
132+
`toolbox-rmi(1)` `toolbox-help(1)`, https://github.com/containers/toolbox

0 commit comments

Comments
 (0)