Bird
0
0

What happens if you run this command?

medium📝 Command Output Q5 of 15
Docker - Security
What happens if you run this command?
docker run --user nobody alpine id -u
APrints 0 because 'nobody' is root
BFails with 'user not found' error
CPrints the UID of 'nobody' user, usually 65534
DPrints the container's default user ID
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'nobody' user in alpine

    Alpine has a 'nobody' user with UID usually 65534.
  2. Step 2: id -u prints current user ID

    Running as 'nobody' prints its UID, not root (0).
  3. Final Answer:

    Prints the UID of 'nobody' user, usually 65534 -> Option C
  4. Quick Check:

    Running as named user prints that user's UID = B [OK]
Quick Trick: Named users print their UID with id -u [OK]
Common Mistakes:
  • Assuming 'nobody' is root
  • Expecting error if user exists
  • Thinking default user ID is printed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes