1podman-exec(1) General Commands Manual podman-exec(1)
2
3
4
6 podman-exec - Execute a command in a running container
7
8
10 podman exec [options] container [command [arg ...]]
11
12
14 podman exec executes a command in a running container.
15
16
18 --env, -e
19
20
21 You may specify arbitrary environment variables that are available for
22 the command to be executed.
23
24
25 --interactive, -i
26
27
28 Not supported. All exec commands are interactive by default.
29
30
31 --latest, -l
32
33
34 Instead of providing the container name or ID, use the last created
35 container. If you use methods other than Podman to run containers such
36 as CRI-O, the last started container could be from either of those
37 methods.
38
39
40 The latest option is not supported on the remote client.
41
42
43 --preserve-fds=N
44
45
46 Pass down to the process N additional file descriptors (in addition to
47 0, 1, 2). The total FDs will be 3+N.
48
49
50 --privileged
51
52
53 Give the process extended Linux capabilities when running the command
54 in container.
55
56
57 --tty, -t
58
59
60 Allocate a pseudo-TTY.
61
62
63 --user, -u
64
65
66 Sets the username or UID used and optionally the groupname or GID for
67 the specified command. The following examples are all valid: --user
68 [user | user:group | uid | uid:gid | user:gid | uid:group ]
69
70
71 --workdir, -w=""
72
73
74 Working directory inside the container
75
76
77 The default working directory for running binaries within a container
78 is the root directory (/). The image developer can set a different
79 default with the WORKDIR instruction, which can be overridden when
80 creating the container.
81
82
84 $ podman exec -it ctrID ls $ podman exec -it -w /tmp myCtr pwd $ podman
85 exec --user root ctrID ls
86
87
89 podman(1), podman-run(1)
90
91
93 December 2017, Originally compiled by Brent Baude ⟨bbaude@redhat.com⟩
94
95
96
97 podman-exec(1)