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