โ† All DevOps Flashcard Decks

Docker & Containerization Flashcards

6 cards from real DevOps practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Docker & Containerization flashcards as text
  1. What is a multi-stage Docker build used for?

    Answer: To reduce final image size by discarding build-time dependencies

    Multi-stage builds use multiple FROM statements to separate the build environment from the runtime environment, keeping the final image small and secure.

  2. What is Docker Compose primarily used for?

    Answer: Defining and running multi-container Docker applications with a single YAML file

    Docker Compose reads a `docker-compose.yml` file to define, configure, and start multiple interconnected containers as a single application.

  3. Which Docker command removes all stopped containers, unused images, networks, and build cache?

    Answer: docker system prune

    `docker system prune` frees disk space by removing stopped containers, dangling images, unused networks, and build cache in one command.

  4. What is a Docker volume used for?

    Answer: Persisting data generated by and used by Docker containers

    Docker volumes provide persistent storage that survives container restarts and deletions, managed by Docker outside the container's writable layer.

  5. What does the .dockerignore file do?

    Answer: Excludes files and directories from the Docker build context

    The .dockerignore file lists patterns of files to exclude from the build context sent to the Docker daemon, reducing build time and preventing sensitive files from being included.

  6. What is the purpose of the CMD instruction in a Dockerfile?

    Answer: Provides the default command to run when a container starts

    CMD specifies the default command executed when a container is started from the image, and can be overridden by arguments passed to `docker run`.