Flashcards · Docker · Free
Docker flashcards, generated for you.
Example Docker study cards to learn from right now — then generate a full set from your own notes (plus a practice quiz) and export to Quizlet or Anki. Free, no account needed.
Example Docker flashcards
What is Docker and what problem does it solve?
Docker is a containerization platform that packages applications with their dependencies into isolated, lightweight containers. It solves the 'works on my machine' problem by ensuring consistent environments across development, testing, and production.
What is the difference between an image and a container?
A Docker image is a read-only template with code, runtime, and dependencies. A container is a running instance of an image—it's a live, isolated process with its own filesystem, network, and resource limits.
What does the command `docker run -d -p 8080:80 nginx` do?
Starts an nginx container in detached mode (-d), mapping port 8080 on the host to port 80 in the container (-p). The container runs in the background.
What is a Dockerfile and what are the key instructions?
A Dockerfile is a script defining how to build a Docker image. Key instructions: FROM (base image), RUN (execute commands), COPY/ADD (add files), WORKDIR (set directory), EXPOSE (document ports), CMD/ENTRYPOINT (default process).
What is the purpose of docker-compose and when do you use it?
docker-compose orchestrates multi-container applications using a single YAML file. Use it when you need multiple services (app, database, cache) to run together locally or in development, defining networking and volumes in one place.
How do you mount a volume in Docker and why would you use it?
Use `-v /host/path:/container/path` or named volumes with `docker volume create`. Volumes persist data beyond container lifecycle, enable code hot-reload during development, and share data between containers.
What is a Docker network and what types exist?
Docker networks enable container-to-container communication. Types: bridge (default, isolated network), host (container shares host network), overlay (for swarm/multi-host), none (no networking). Use custom bridge for DNS service discovery.
What does `docker exec -it <container> /bin/bash` do and when would you use it?
Executes an interactive bash shell inside a running container. Use it for debugging, inspecting logs, checking environment variables, or running commands without stopping the container.
Explain the purpose of ENTRYPOINT vs CMD in a Dockerfile.
ENTRYPOINT defines the main process that always runs; CMD provides default arguments to ENTRYPOINT or a command if no ENTRYPOINT exists. Together: `ENTRYPOINT ['python', 'app.py']` + `CMD ['--debug']` creates a flexible, overrideable default.
What are best practices for building efficient, production-ready Docker images?
Use specific base image tags (not latest), minimize layers with multi-line RUN commands, order instructions by change frequency, use .dockerignore to exclude files, employ multi-stage builds to reduce image size, run as non-root user, and scan images for vulnerabilities.
Make your own Docker study set
Flashcards for related topics
Studying Docker to build with AI? MindloomHQ turns it into real skills — structured courses, agent projects, and certificates.
Explore MindloomHQ →