What role does a manager node play in a Docker Swarm cluster?
Manages cluster state, schedules tasks, and ensures service availability
Executes the actual application tasks within containers
Provides networking and load balancing for the cluster
Stores and distributes Docker images to worker nodes
What is the primary way to define and deploy applications in a Docker Swarm?
Docker Swarm stacks
Kubernetes Deployments
Docker Compose files
Dockerfiles
Which Dockerfile instruction is used to define a health check for a container?
HEALTHCHECK
EXPOSE
CHECK
RUN
Which data persistence approach provides the highest level of isolation between the host system and container data?
Bind mounts.
Directly writing data to the container's filesystem.
Docker volumes.
Using a shared network drive.
What is the purpose of the ONBUILD instruction in a Dockerfile?
ONBUILD
To specify the base image for the Dockerfile.
To define commands that will be executed when a new image is built FROM the current image.
To define commands that will be executed when the container starts.
To specify environment variables that will be available at build time.
What is the primary function of a Docker Registry?
Building Docker images
Managing network traffic between containers
Running Docker containers in production
Storing and distributing Docker images
Which command is used to list all running Docker containers?
docker run
docker start
docker ps
docker images
How does Docker optimize build cache for the RUN instruction?
It caches the result of each individual command within a RUN instruction.
It caches the entire file system state after each RUN instruction.
It only caches the output of the RUN command if it has changed.
It does not cache the results of RUN instructions.
In Docker Compose, what is the primary function of environment variables?
To configure the network settings for services
To pass dynamic configuration values to services at runtime
To specify the build context for a service's Dockerfile
To define the Docker image to be used for a service
What is the purpose of 'docker exec' command?
To list all available Docker images
To execute a command inside a running container
To build a Docker image from a Dockerfile
To push a Docker image to a registry