What is a user namespace and what is `userns-remap`?
AdvancedConceptContainers, VMs & Isolation Internals
Answer
A user namespace maps UIDs inside the container to different UIDs on the host, so container root (0) can be an unprivileged UID like 100000 outside. If it escapes, it has no host privileges. Enable daemon-wide with "userns-remap": "default" in /etc/docker/daemon.json; Docker creates the dockremap user and reads ranges from /etc/subuid. Trade-offs: bind-mount ownership gets awkward, and some options (--privileged, --pid=host) are incompatible.
More on Containers, VMs & Isolation Internals
What is a container, in one sentence?BeginnerHow do containers differ from virtual machines?BeginnerCan a Linux container run a Windows application, or the reverse?IntermediateWhat are Linux namespaces? Name the ones Docker uses.BeginnerWhat are cgroups and what do they do for containers?BeginnerWhat is PID 1 in a container and why does it matter?Intermediate