1toolbox-run(1)              General Commands Manual             toolbox-run(1)
2
3
4

NAME

6       toolbox-run - Run a command in an existing toolbox container
7
8

SYNOPSIS

10       toolbox run [--container NAME | -c NAME]
11                   [--distro DISTRO | -d DISTRO]
12                   [--preserve-fds N]
13                   [--release RELEASE | -r RELEASE]
14                   [COMMAND]
15
16

DESCRIPTION

18       Runs  a  command  inside  an  existing toolbox container. The container
19       should have been created using the toolbox create command.
20
21
22       On Fedora, the default container is known as fedora-toolbox-N, where  N
23       is  the release of the host. A specific container can be selected using
24       the --container option.
25
26
27       A toolbox container is an OCI  container.  Therefore,  toolbox  run  is
28       analogous to a podman start followed by a podman exec.
29
30

OPTIONS

32       The following options are understood:
33
34
35       --container NAME, -c NAME
36
37
38       Run  command  inside  a  toolbox container with the given NAME. This is
39       useful when there are multiple toolbox containers created from the same
40       image,  or entirely customized containers created from custom-built im‐
41       ages.
42
43
44       --distro DISTRO, -d DISTRO
45
46
47       Run command inside a toolbox container for a different operating system
48       DISTRO  than  the host. Has to be coupled with --release unless the se‐
49       lected DISTRO matches the host system.
50
51
52       --preserve-fds N
53
54
55       Pass down to command N additional file descriptors (in addition  to  0,
56       1, 2). The total number of file descriptors will be 3+N.
57
58
59       --release RELEASE, -r RELEASE
60
61
62       Run command inside a toolbox container for a different operating system
63       RELEASE than the host.
64
65

EXIT STATUS

67       The exit code gives information about why the command within  the  con‐
68       tainer failed to run or why it exited.
69
70
71       1 There was an internal error in Toolbox
72
73
74       125 There was an internal error in Podman
75
76
77       126 The run command could not be invoked
78
79
80              $ toolbox run /etc; echo $?
81              /bin/sh: line 1: /etc: Is a directory
82              /bin/sh: line 1: exec: /etc: cannot execute: Is a directory
83              Error: failed to invoke command /etc in container fedora-toolbox-36
84              126
85
86
87
88       127  The  run command cannot be found or the working directory does not
89       exist
90
91
92              $ toolbox run foo; echo $?
93              /bin/sh: line 1: exec: foo: not found
94              Error: command foo not found in container fedora-toolbox-36
95              127
96
97
98
99       Exit code The run command exit code
100
101
102              $ toolbox run false; echo $?
103              1
104
105
106

EXAMPLES

108   Run ls inside a toolbox container using the default image matching the host
109       OS
110              $ toolbox run ls -la
111
112
113
114   Run emacs inside a toolbox container using the default image for Fedora 36
115              $ toolbox run --distro fedora --release f36 emacs
116
117
118
119   Run uptime inside a custom toolbox container using a custom image
120              $ toolbox run --container foo uptime
121
122
123

SEE ALSO

125       toolbox(1), podman(1), podman-exec(1), podman-start(1)
126
127
128
129                                                                toolbox-run(1)
Impressum