From 00caebde61256dc7baaf99e5052305a1e15cbee5 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 30 Jul 2018 09:44:02 -0400 Subject: [PATCH] Add documentations on how to setup /etc/subuid and /etc/subgid Signed-off-by: Daniel J Walsh Closes: #1185 Approved by: giuseppe --- docs/podman.1.md | 11 +++++++++++ vendor.conf | 2 +- .../containers/storage/pkg/idtools/idtools.go | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/podman.1.md b/docs/podman.1.md index 1ca420d128..b5331a45d5 100644 --- a/docs/podman.1.md +++ b/docs/podman.1.md @@ -171,6 +171,17 @@ Containers created by a non-root user are not visible to other users and are not It is required to have multiple uids/gids set for an user. Be sure the user is present in the files `/etc/subuid` and `/etc/subgid`. +If you have a recent version of usermod, you can execute the following +commands to add the ranges to the files + + $ sudo usermod --add-subuids 10000-75535 USERNAME + $ sudo usermod --add-subgids 10000-75535 USERNAME + +Or just add the content manually. + + $ echo USERNAME:10000:65536 >> /etc/subuid + $ echo USERNAME:10000:65536 >> /etc/subgid + Images are pulled under `XDG_DATA_HOME` when specified, otherwise in the home directory of the user under `.local/share/containers/storage`. Currently it is not possible to create a network device, so rootless containers need to run in the host network namespace. If a rootless container creates a network namespace, diff --git a/vendor.conf b/vendor.conf index e477d8e2f5..aff284dfbb 100644 --- a/vendor.conf +++ b/vendor.conf @@ -11,7 +11,7 @@ github.com/containerd/continuity master github.com/containernetworking/cni v0.7.0-alpha1 github.com/containernetworking/plugins 1562a1e60ed101aacc5e08ed9dbeba8e9f3d4ec1 github.com/containers/image 134f99bed228d6297dc01d152804f6f09f185418 -github.com/containers/storage 956a1971694f18fd602b1203c0a2d192e2cc88a1 +github.com/containers/storage 17c7d1fee5603ccf6dd97edc14162fc1510e7e23 github.com/containers/psgo 382fc951fe0a8aba62043862ce1a56f77524db87 github.com/coreos/go-systemd v14 github.com/cri-o/ocicni master diff --git a/vendor/github.com/containers/storage/pkg/idtools/idtools.go b/vendor/github.com/containers/storage/pkg/idtools/idtools.go index 68a072db22..9c591aff83 100644 --- a/vendor/github.com/containers/storage/pkg/idtools/idtools.go +++ b/vendor/github.com/containers/storage/pkg/idtools/idtools.go @@ -140,10 +140,10 @@ func NewIDMappings(username, groupname string) (*IDMappings, error) { return nil, err } if len(subuidRanges) == 0 { - return nil, fmt.Errorf("No subuid ranges found for user %q", username) + return nil, fmt.Errorf("No subuid ranges found for user %q in %s", username, subuidFileName) } if len(subgidRanges) == 0 { - return nil, fmt.Errorf("No subgid ranges found for group %q", groupname) + return nil, fmt.Errorf("No subgid ranges found for group %q in %s", groupname, subgidFileName) } return &IDMappings{