Why run containers as non-root?

BeginnerConceptDocker
Answer

If the app is compromised, root in the container is much closer to root on the host (kernel bugs, mounted sockets). Add USER 10001 in the Dockerfile.

All Real-World Interview questions Roadmap: Interview readiness

More on Docker