Container images, Dockerfiles, and orchestration basics for containerized applications.
39 cards · basic cards · AI-written, checked twice. Edit anything.
- What is a Docker container?
Show answer
A lightweight, standalone, executable package that includes everything needed to run an application
- What is a Docker image?
Show answer
A read-only template used to create containers, consisting of layered filesystems and metadata
- What does the RUN instruction do in a Dockerfile?
Show answer
Executes a command during the image build process and records the result in a new layer
- What does the COPY instruction do in a Dockerfile?
Show answer
Copies files from the host machine into the image during the build process
- What does the ADD instruction do in a Dockerfile?
Show answer
Similar to COPY, but also supports URLs and can auto-extract tar archives
- What does the FROM instruction do in a Dockerfile?
Show answer
Specifies the base image from which to build a new image
- What does the CMD instruction do in a Dockerfile?
Show answer
Defines the default command to run when a container starts
- What does the ENTRYPOINT instruction do in a Dockerfile?
Show answer
Configures the container to run as an executable with a fixed primary command
- What is the difference between CMD and ENTRYPOINT in a Dockerfile?
Show answer
CMD specifies default arguments, ENTRYPOINT specifies the main executable
- What does the EXPOSE instruction do in a Dockerfile?
Show answer
Documents which ports the container listens on, but does not actually publish them
- What does the ENV instruction do in a Dockerfile?
Show answer
Sets environment variables that persist in the running container
- What does the WORKDIR instruction do in a Dockerfile?
Show answer
Sets the working directory for subsequent RUN, COPY, ADD, ENTRYPOINT, and CMD instructions
- What does the VOLUME instruction do in a Dockerfile?
Show answer
Creates a mount point for external volumes to be attached to the container
- What is a Docker layer?
Show answer
An intermediate image created by each instruction in a Dockerfile; layers are cached for faster rebuilds
- What does the docker build command do?
Show answer
Reads a Dockerfile and builds a Docker image from the instructions