What is the purpose of a Swarm service's 'update_config' setting?
To change the environment variables for the service's containers
To scale the number of replicas for the service up or down
To automatically update the service's Docker image to the latest version
To configure how updates to the service are rolled out across replicas
What is the default networking mode in Docker Compose when no explicit network configuration is provided?
Bridge
Host
Overlay
None
Why would you set up a private Docker Registry instead of using a public one like Docker Hub?
To share images publicly with the open-source community
To reduce network latency and improve image pull times
To increase the storage capacity for your images
To easily explore and discover new public images
Which flag is used with 'docker logs' to follow log output in real-time?
-f
-r
-t
-d
What is the purpose of the ONBUILD instruction in a Dockerfile?
ONBUILD
To define commands that will be executed when a new image is built FROM the current image.
To specify the base image for the Dockerfile.
To specify environment variables that will be available at build time.
To define commands that will be executed when the container starts.
What role does a manager node play in a Docker Swarm cluster?
Manages cluster state, schedules tasks, and ensures service availability
Provides networking and load balancing for the cluster
Executes the actual application tasks within containers
Stores and distributes Docker images to worker nodes
What is the primary function of a Docker Registry?
Running Docker containers in production
Storing and distributing Docker images
Managing network traffic between containers
Building Docker images
How does Docker optimize build cache for the RUN instruction?
RUN
It caches the entire file system state after each RUN instruction.
It caches the result of each individual command within a 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 specify the build context for a service's Dockerfile
To define the Docker image to be used for a service
To configure the network settings for services
To pass dynamic configuration values to services at runtime
How can you create a custom network with specific configurations (e.g., IP range, driver) in Docker Compose?
Docker Compose does not allow custom network configurations
By using the docker network create command separately and referencing the network in the docker-compose.yml file
docker network create
docker-compose.yml
By specifying the network configurations within the networks section of the docker-compose.yml file
networks
By defining the network within the services section of the docker-compose.yml file
services