Docker skill check
Practise Docker: images and layers, writing Dockerfiles, containers, networking, volumes, Compose, and image security.
15
Questions
11 min
Timer can't pause
Multiple choice
Docker Engine 26
Choose a level
Topics
- Images and layers
- Dockerfiles
- Containers
- Networking
- Volumes
- Compose
- Registries
- Security
Do
Use scratch paper or a notepad to work things out. Skip a question and come back to it later.
Don't
Look up answers during the check. Open the check in more than one tab or window.
Easy · 15 questions · 11 min
By starting, you agree to the Terms and Privacy Policy.
Practice checks each answer as you go, with an explanation. The exam is checked when you submit; 9 of 15 passes and earns a certificate.
Checking your levels…
Certificates come from the certified exam: pass with 9 of 15 while signed in. View a sample certificate.
Sample Docker questions with answers
These are never used in a check, so seeing their answers here won't give anything away.
Question 1 · Easy · Containers
A developer runs the command:docker run -d --name web-server -p 8080:80 nginx. What does the parameter '-p 8080:80' do?- A.It sets an internal container firewall rule allowing connections from host port 8080 only.
- B.It maps port 8080 on the host machine to port 80 inside the container.
- C.It maps port 80 on the host machine to port 8080 inside the container.
- D.It restricts container network traffic to a range spanning between port 80 and port 8080.
Show answer
B. It maps port 8080 on the host machine to port 80 inside the container.
The syntax for port publishing with -p is HOST_PORT:CONTAINER_PORT. Therefore, traffic sent to port 8080 on the host machine is forwarded to port 80 inside the container.Question 2 · Easy · Volumes
A developer needs data written by a PostgreSQL database container to persist even if the container is stopped and removed with 'docker rm -f'. Which Docker feature is best suited for this?- A.A committed image layer generated automatically when the container stops.
- B.A secondary writable container layer allocated via the --preserve-data flag.
- C.A named Docker volume mounted to the container's data directory.
- D.An in-memory tmpfs mount specified at container runtime.
Show answer
C. A named Docker volume mounted to the container's data directory.
Named volumes are managed by Docker on the host filesystem outside the container's lifecycle. Data inside a volume survives container stop and removal operations.Question 3 · Moderate · Images and layers
A developer wants to reduce the final image size of an application that compiles source code. Which Dockerfile approach prevents build tools and intermediate artifacts from appearing in the final image?- A.Running 'apt-get purge -y build-essential' in a subsequent RUN instruction after compilation
- B.Using a multi-stage build and copying only the compiled artifacts into the final stage
- C.Adding the source directories and build tools to the .dockerignore file before building
- D.Exporting the container using 'docker export' and importing it with 'docker import'
Show answer
B. Using a multi-stage build and copying only the compiled artifacts into the final stage
Multi-stage builds allow compiling in an intermediate stage and copying only the resulting binary to a clean final stage, leaving build tooling behind without bloating layer history.Question 4 · Advanced · Dockerfiles
What is the key functional difference betweenRUN --mount=type=cache,target=/root/.cacheand committing files directly to a layer during image builds with BuildKit?- A.Mounted cache is strictly ephemeral and discarded immediately once the specific RUN instruction exits.
- B.Mounted cache contents are preserved across build invocations on the host but are excluded from the final image layers.
- C.Mounted cache directories are compressed into tarballs and automatically exported to the container's volume store upon build completion.
- D.Mounted cache requires an external NFS server configured in the Docker daemon configuration.
Show answer
B. Mounted cache contents are preserved across build invocations on the host but are excluded from the final image layers.
Cache mounts (--mount=type=cache) persist across builds to accelerate repeated operations (like package manager caches), but the mounted data is not committed to the image layer.
How scoring and certificates work
- Each check has 15 multiple-choice questions with one correct answer, and one timer for the whole check. A question you leave unanswered scores nothing.
- Practice is free without an account and shows whether each answer is right as you go, with an explanation.
- The certified exam is scored when you submit. 60% passes, which is 9 of 15. Easy unlocks Moderate, and Moderate unlocks Advanced.
- Passing the exam while signed in earns a free certificate, valid for one year, with its own verification page. See a sample certificate.
Free tools for Docker: YAML to JSON, chmod Calculator, Cron Expression Parser