What are Linux capabilities and how does Docker use them?
AdvancedConceptContainers, VMs & Isolation Internals
Answer
Capabilities split root's power into ~40 units (CAP_NET_ADMIN, CAP_SYS_ADMIN, ...). Docker starts containers with a reduced default set (about 14, e.g. CHOWN, NET_BIND_SERVICE, SETUID, KILL) even for root. You can adjust with flags:
docker run --cap-drop ALL --cap-add NET_BIND_SERVICE nginx
--privileged grants all capabilities and device access, which effectively removes isolation.
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