Rootless Docker: `dockerd-rootless.sh` fails with `newuidmap: write to uid_map failed: Operation not permitted`
IntermediateTroubleshootingSecurity, rootless, Podman and containerd
Answer
Likely causes → Missing uidmap package/setuid bit or no subuid/subgid ranges for the user.
Diagnose →
grep $USER /etc/subuid /etc/subgid
ls -l $(which newuidmap)
sysctl kernel.unprivileged_userns_clone user.max_user_namespaces
Fix → Install uidmap, add ranges (usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER), enable user namespaces.
Prevent → Include these in the base image.
More on Security, rootless, Podman and containerd
Rootless: `rootlesskit: failed to ... listen tcp 0.0.0.0:80: bind: permission denied`BeginnerRootless Docker stops when you log out of SSH.BeginnerRootless containers: `Error: ... cannot set up namespace using "/usr/bin/newuidmap": should have setuid or have filecaps setuid` (Podman).IntermediatePodman: `Error: short-name "nginx" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"`BeginnerPodman rootless: `Error: cannot find newuidmap` / ping fails inside container: `ping: permission denied (are you root?)`.IntermediateRootless Podman volumes show wrong owner: files appear owned by a huge UID (e.g. 100999) on the host.Advanced