summaryrefslogtreecommitdiff
path: root/docs/source/markdown/options/user.md
blob: 6cf12d3473ef5169c20d25d32a29aa3c21dc1e2e (plain)
1
2
3
4
5
6
7
#### **--user**, **-u**=*user[:group]*

Sets the username or UID used and, optionally, the groupname or GID for the specified command. Both *user* and *group* may be symbolic or numeric.

Without this argument, the command will run as the user specified in the container image. Unless overridden by a `USER` command in the Containerfile or by a value passed to this option, this user generally defaults to root.

When a user namespace is not in use, the UID and GID used within the container and on the host will match. When user namespaces are in use, however, the UID and GID in the container may correspond to another UID and GID on the host. In rootless containers, for example, a user namespace is always used, and root in the container will by default correspond to the UID and GID of the user invoking Podman.