0
0
Dockerdevops~10 mins

Minimizing layers in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the Dockerfile line to start from the official Python image.

Docker
FROM [1]
Drag options to blanks, or click blank then click option'
Aalpine:3.18
Bnode:18
Cpython:3.12-slim
Dubuntu:latest
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a non-Python base image like Ubuntu or Node.
2fill in blank
medium

Complete the RUN command to update package lists in one layer.

Docker
RUN apt-get update && apt-get [1] -y curl
Drag options to blanks, or click blank then click option'
Aupgrade
Binstall
Cremove
Dclean
Attempts:
3 left
💡 Hint
Common Mistakes
Using upgrade or remove instead of install.
3fill in blank
hard

Fix the error in combining commands to minimize layers.

Docker
RUN apt-get update [1] apt-get install -y curl
Drag options to blanks, or click blank then click option'
A||
B;
C|
D&&
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolon or pipe which do not ensure success before next command.
4fill in blank
hard

Fill both blanks to combine copying files and installing dependencies in one RUN command.

Docker
COPY requirements.txt /app/requirements.txt
RUN pip [2] -r /app/requirements.txt [1] rm /app/requirements.txt
Drag options to blanks, or click blank then click option'
A&&
Binstall
Cupdate
D&&&
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid separators or wrong pip commands.
5fill in blank
hard

Fill all three blanks to create a minimal Dockerfile that installs curl and cleans cache in one RUN.

Docker
FROM python:3.12-slim
RUN apt-get update [1] apt-get install -y [2] [3] apt-get clean
Drag options to blanks, or click blank then click option'
A&&
Bcurl
D|
Attempts:
3 left
💡 Hint
Common Mistakes
Using pipe instead of &&, or missing package name.