File: toolbox-init-container.1.md

package info (click to toggle)
golang-github-containers-toolbox 0.0.99.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,616 kB
  • sloc: sh: 3,195; ansic: 40; makefile: 36; python: 33
file content (122 lines) | stat: -rw-r--r-- 3,689 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
% toolbox-init-container 1

## NAME
toolbox\-init\-container - Initialize a running container

## SYNOPSIS
**toolbox init-container** *--gid GID*
                       *--home HOME*
                       *--home-link*
                       *--media-link*
                       *--mnt-link*
                       *--monitor-host*
                       *--shell SHELL*
                       *--uid UID*
                       *--user USER*

## DESCRIPTION

Initializes a newly created container that's running. It is primarily meant to
be used as the entry point for all toolbox containers, and must be run inside
the container that's to be initialized. It is not expected to be directly
invoked by humans, and cannot be used on the host.

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

OCI containers are inherently immutable. Configuration options passed through
`podman create` are baked into the definition of the OCI container, and can't
be changed later. This means that changes and improvements made in newer
versions of Toolbox can't be applied to pre-existing toolbox containers
created by older versions of Toolbox. This is avoided by using the entry point
to configure the container at runtime.

The entry point of a toolbox container customizes the container to fit the
current user by ensuring that it has a user that matches the one on the host,
and grants it `sudo` and `root` access.

Crucial configuration files, such as `/etc/host.conf`, `/etc/hosts`,
`/etc/localtime`, `/etc/resolv.conf` and `/etc/timezone`, inside the container
are kept synchronized with the host. The entry point also bind mounts various
subsets of the host's filesystem hierarchy to their corresponding locations
inside the container to provide seamless integration with the host. This
includes `/run/libvirt`, `/run/systemd/journal`, `/run/udev/data`,
`/var/lib/libvirt`, `/var/lib/systemd/coredump`, `/var/log/journal` and others.

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

## OPTIONS ##

The following options are understood:

**--gid** GID

Pass GID as the user's numerical group ID from the host to the toolbox
container.

**--home** HOME

Create a user inside the toolbox container whose login directory is HOME. This
option is required.

**--home-link**

Make `/home` a symbolic link to `/var/home`.

**--media-link**

Make `/media` a symbolic link to `/run/media`.

**--mnt-link**

Make `/mnt` a symbolic link to `/var/mnt`.

**--monitor-host**

Ensures that certain configuration files inside the toolbox container are kept
synchronized with their counterparts on the host, and bind mounts some paths
from the host's file system into the container.

The synchronized files are:

- `/etc/host.conf`
- `/etc/hosts`
- `/etc/localtime`
- `/etc/resolv.conf`
- `/etc/timezone`

The bind mounted paths are:

- `/etc/machine-id`
- `/run/libvirt`
- `/run/systemd/journal`
- `/run/systemd/resolve`
- `/run/udev/data`
- `/tmp`
- `/var/lib/flatpak`
- `/var/lib/libvirt`
- `/var/lib/systemd/coredump`
- `/var/log/journal`
- `/var/mnt`

**--shell** SHELL

Create a user inside the toolbox container whose login shell is SHELL. This
option is required.

**--uid** UID

Create a user inside the toolbox container whose numerical user ID is UID. This
option is required.

**--user** USER

Create a user inside the toolbox container whose login name is LOGIN. This
option is required.

## SEE ALSO

`toolbox(1)`, `podman(1)`, `podman-create(1)`, `podman-start(1)`