Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.
Exam details
Docker is an open-source platform that automates the deployment of applications inside lightweight, portable containers. Containers package an application with all its dependencies, ensuring it runs consistently across different environments.
A Docker container is a runnable instance of a Docker image. It is an isolated process that shares the host OS kernel but has its own filesystem, networking, and process space. Containers are ephemeral by default.
A Docker image is a read-only template used to create containers. It consists of layered filesystems built from a Dockerfile. Images are stored in registries and can be tagged with versions like myapp:1.0.
FROM sets the base image for subsequent instructions. It must be the first instruction in a Dockerfile (aside from ARG).
Example: FROM python:3.11-slim
You can also use FROM scratch to start with an empty image.
RUN executes a command during the image build process and commits the result as a new layer.
Example: RUN apt-get update && apt-get install -y curl
Best practice: chain commands with && to reduce layers.