advancedTop 100 Interview Questions

Why might a production Dockerfile explicitly set a non-root USER?

Running as root inside a container means that if an attacker achieves code execution, they have root privileges within that container's namespace, increasing the impact of any container-breakout vulnerability. Switching to a dedicated non-root user limits the blast radius of a compromise.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full DevOps Mastery library.

Why might a production Dockerfile explicitly set a non-root USER?

Next Step

Continue to What is the main difference between a named volume and a bind mount?← Back to all Docker questions