Security, topic 33 of 41
Runtime security
By default a container's process runs as root, and a break out of the container is then root on the host. Set USER in the Dockerfile to an unprivileged user, drop the Linux capabilities you do not need with --cap-drop ALL, use --read-only with a tmpfs for scratch files, and never use --privileged for a normal workload.
Access to the Docker socket is root on the host: never mount it into a container you do not trust. Rootless mode runs the daemon itself as an ordinary user.
On Opsfolk
Nothing of ours for this topic yet: an article is on its way.
Elsewhere
- Docker securityOfficial
- Rootless modeOfficial
- Seccomp profilesOfficial