Intermediate Docker & Containers
Q61 / 100

What problem does setting a non-root "USER" instruction in a Dockerfile address?

Correct! Well done.

Incorrect.

The correct answer is B) By default, containers run as root, which poses a security risk if the application is compromised; switching to a non-root user limits the potential damage from container escapes or vulnerabilities

B

Correct Answer

By default, containers run as root, which poses a security risk if the application is compromised; switching to a non-root user limits the potential damage from container escapes or vulnerabilities

Explanation

Running as root inside a container increases the blast radius of a potential vulnerability, especially if container isolation is somehow bypassed; the USER instruction switches to a less-privileged user for defense in depth.

Progress
61/100