podman: honor env variable PODMAN_USERNS

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2019-05-24 13:39:13 +02:00
parent f09370c68b
commit 5eb321ac37
No known key found for this signature in database
GPG key ID: E4730F97F60286ED
3 changed files with 3 additions and 3 deletions

View file

@ -517,7 +517,7 @@ func getCreateFlags(c *cliconfig.PodmanCommand) {
"Username or UID (format: <name|uid>[:<group|gid>])",
)
createFlags.String(
"userns", "",
"userns", os.Getenv("PODMAN_USERNS"),
"User namespace to use",
)
createFlags.String(

View file

@ -730,7 +730,7 @@ Without this argument the command will be run as root in the container.
**--userns**=keep-id
**--userns**=ns:my_namespace
Set the user namespace mode for the container. The use of userns is disabled by default.
Set the user namespace mode for the container. It defaults to the **PODMAN_USERNS** environment variable. An empty value means user namespaces are disabled.
- `host`: run in the user namespace of the caller. This is the default if no user namespace options are set. The processes running in the container will have the same privileges on the host as any other process launched by the calling user.
- `keep-id`: creates a user namespace where the current rootless user's UID:GID are mapped to the same values in the container. This option is ignored for containers created by the root user.

View file

@ -766,7 +766,7 @@ Without this argument the command will be run as root in the container.
**--userns**=keep-id
**--userns**=ns:my_namespace
Set the user namespace mode for the container. The use of userns is disabled by default.
Set the user namespace mode for the container. It defaults to the **PODMAN_USERNS** environment variable. An empty value means user namespaces are disabled.
- `host`: run in the user namespace of the caller. This is the default if no user namespace options are set. The processes running in the container will have the same privileges on the host as any other process launched by the calling user.
- `keep-id`: creates a user namespace where the current rootless user's UID:GID are mapped to the same values in the container. This option is ignored for containers created by the root user.