I’m playing with a test Nomad cluster, to manage Docker containers. For obvious security reason, I’d like to run Docker daemon with “userns-remap=default”, which is working nicely for simple workloads.
Just a followup as I found where the issue is coming from. If userns-remap is enabled at the daemon level, file ownership inside Docker images will be remapped, no matter if userns is disabled for a specific container (because Docker images are shared among all the containers). So we end with /bin/mount owned by the remapped user (in my case, 100000), and as /bin/mount is SUID, even root exec’ing it will have the privileges dropped to 100000, and the mount fails.
Now looking for a proper fix for this (I mean, something nicer than a chown root:root or chmod u-s in an entrypoint wrapper)