When choosing a data persistence strategy in Docker, which factor should be considered carefully?
The number of containers running on the host.
The version of Docker being used.
The sensitivity and importance of the data being stored.
The color scheme of the Docker logo.
Which command is used to list all running Docker containers?
docker start
docker run
docker images
docker ps
In Docker Swarm, what is the function of the 'docker stack deploy' command?
To define a new service with specific configurations
To deploy a single container based on a Docker image
To deploy a complete application stack defined in a YAML file
To scale an existing service to a desired number of replicas
What is the primary advantage of using Docker containers in a CI/CD pipeline?
Enhanced environment consistency across development, testing, and production
Guaranteed execution on any operating system
Reduced storage footprint for build artifacts
Elimination of the need for version control
In a Docker Compose setup, how can you link a service to another service's network without directly exposing its ports to the host?
By using the depends_on keyword and specifying the target service
depends_on
It is not possible to achieve this; services must have ports exposed to the host for communication
By defining both services under the same custom network within the networks section
networks
By using the expose keyword in the dependent service's configuration and listing the target service's ports
expose
How can you create a custom network with specific configurations (e.g., IP range, driver) in Docker Compose?
By specifying the network configurations within the networks section of the docker-compose.yml file
docker-compose.yml
By defining the network within the services section of the docker-compose.yml file
services
By using the docker network create command separately and referencing the network in the docker-compose.yml file
docker network create
Docker Compose does not allow custom network configurations
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
Stores and distributes Docker images to worker nodes
Executes the actual application tasks within containers
Which open-source tool is commonly used to set up a private Docker Registry?
Docker Compose
Kubernetes
Docker Registry
Docker Hub
Which flag is used with 'docker logs' to follow log output in real-time?
-f
-r
-d
-t
In a multi-stage Docker build, how can you refer to a specific stage by its index?
It's not possible to refer to stages by index.
By using a numerical index starting from 0.
By using the stage's name.
By using a numerical index starting from 1.