What does `--privileged` do?
IntermediateConceptContainers, VMs & Isolation Internals
Answer
It gives the container all capabilities, disables seccomp and AppArmor confinement, exposes all host devices under /dev, and allows mounting filesystems. A root process inside can usually escape to the host. Use specific --cap-add or --device flags instead; reserve --privileged for things like Docker-in-Docker in isolated CI runners.
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