Slim the Image, Save the Secrets

Use .dockerignore to keep junk and live secrets out of your image.

A advanced Docker challenge worth 20 points. Solve it hands-on in a real Docker environment in your browser - no local setup, no fake shells.

The Challenge

Scenario: site:v1 was built from /root/site with COPY . . — it ships a 40MB backup.tar, log files, and .env with live production secrets. Anyone who pulls the image can read them.

Tasks:

Commands to learn: .dockerignore, docker image inspect -f '{{.Size}}', docker run --rm <img> ls

Run check when done.