Interview Prep/Docker/Image Security & Hardening

What is the risk of mounting `/var/run/docker.sock`, and what do you do instead?

IntermediateProductionImage Security & Hardening
Answer

Access to the socket is equivalent to root on the host: the container can launch a privileged container that mounts /. For CI builds use rootless BuildKit, Buildah, Kaniko-style builders, or Kubernetes-native builders. If something genuinely needs API access (Traefik), put a socket proxy like tecnativa/docker-socket-proxy in front that allows only GET /containers.

All Docker questions Roadmap: Docker & containers

More on Image Security & Hardening