From f09370c68b8b514aca80bfaa34f98fbc5b97d318 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 23 May 2019 22:28:59 +0200 Subject: userns: add new option --userns=keep-id it creates a namespace where the current UID:GID on the host is mapped to the same UID:GID in the container. Signed-off-by: Giuseppe Scrivano --- docs/podman-create.1.md | 2 ++ docs/podman-run.1.md | 2 ++ 2 files changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/podman-create.1.md b/docs/podman-create.1.md index 58e579605..53f4c8fed 100644 --- a/docs/podman-create.1.md +++ b/docs/podman-create.1.md @@ -727,11 +727,13 @@ The followings examples are all valid: Without this argument the command will be run as root in the container. **--userns**=host +**--userns**=keep-id **--userns**=ns:my_namespace Set the user namespace mode for the container. The use of userns is disabled by default. - `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. - `ns`: run the container in the given existing user namespace. This option is incompatible with --gidmap, --uidmap, --subuid and --subgid diff --git a/docs/podman-run.1.md b/docs/podman-run.1.md index a9484a517..95e99cb7e 100644 --- a/docs/podman-run.1.md +++ b/docs/podman-run.1.md @@ -763,11 +763,13 @@ The followings examples are all valid: Without this argument the command will be run as root in the container. **--userns**=host +**--userns**=keep-id **--userns**=ns:my_namespace Set the user namespace mode for the container. The use of userns is disabled by default. - `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. - `ns`: run the container in the given existing user namespace. This option is incompatible with --gidmap, --uidmap, --subuid and --subgid -- cgit v1.2.3-54-g00ecf From 5eb321ac372f5c29f65769a4554ff224186ffb21 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 24 May 2019 13:39:13 +0200 Subject: podman: honor env variable PODMAN_USERNS Signed-off-by: Giuseppe Scrivano --- cmd/podman/common.go | 2 +- docs/podman-create.1.md | 2 +- docs/podman-run.1.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/cmd/podman/common.go b/cmd/podman/common.go index 5e26d9bfd..054b01247 100644 --- a/cmd/podman/common.go +++ b/cmd/podman/common.go @@ -517,7 +517,7 @@ func getCreateFlags(c *cliconfig.PodmanCommand) { "Username or UID (format: [:])", ) createFlags.String( - "userns", "", + "userns", os.Getenv("PODMAN_USERNS"), "User namespace to use", ) createFlags.String( diff --git a/docs/podman-create.1.md b/docs/podman-create.1.md index 53f4c8fed..cbd6d9a99 100644 --- a/docs/podman-create.1.md +++ b/docs/podman-create.1.md @@ -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. diff --git a/docs/podman-run.1.md b/docs/podman-run.1.md index 95e99cb7e..78e8a5d6e 100644 --- a/docs/podman-run.1.md +++ b/docs/podman-run.1.md @@ -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. -- cgit v1.2.3-54-g00ecf