Interview Prep/Docker/Containers, VMs & Isolation Internals

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.

All Docker questions Roadmap: Docker & containers

More on Containers, VMs & Isolation Internals