🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Docker: all 10 questions

Quiz: Docker · Question 9 of 10

Why does the Dockerfile switch to USER app in the final stage?

Why does the Dockerfile switch to USER app in the final stage?

  1. A.Java requires a user named app
  2. B.It makes the image smaller
  3. C.So the app does not run as root inside the container, limiting damage if it is attacked
  4. D.To publish the port
Answer & explanation

Correct answer: So the app does not run as root inside the container, limiting damage if it is attacked

Running as a normal user is a basic container security rule.

Can you get the rest right without peeking?

Take the timed Quiz: Docker quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →