Learn Everything

Paths/DevOps Engineer/Docker / Image Hardening

Challengeadvanceddocker:24Ask AI

Run the Container as a Non-Root User

Containers are often root on the host's behalf, which turns any bug into a host bug. Build an image that creates an unprivileged user and switches to it before the app starts.

Validator

⏱ 0:00

IDLE — checks run live as you type commands; submit when done

01Requirements

live checks
  • File ~/app/Dockerfile creates an unprivileged user○
  • The image runs as that user○
  • A container from app:secure is running and mapped to port 8081○

02Walkthrough

1 of 8 revealed
  1. 01

    Create the app directory

    The Dockerfile lives next to the code it packages.

    mkdir ~/app
  2. 7 locked · each failed submit reveals one

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — docker:24

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list