What is the primary advantage of using Docker volumes over bind mounts for data persistence?
Bind mounts are generally more secure than Docker volumes.
Volumes are managed by Docker and provide data portability across different host environments.
Bind mounts are easier to back up and restore compared to Docker volumes.
Volumes offer better performance compared to bind mounts.
What is the purpose of 'docker exec' command?
To execute a command inside a running container
To push a Docker image to a registry
To build a Docker image from a Dockerfile
To list all available Docker images
In a multi-stage Docker build, how can you refer to a specific stage by its index?
By using the stage's name.
By using a numerical index starting from 0.
It's not possible to refer to stages by index.
By using a numerical index starting from 1.
Which flag is used with 'docker logs' to follow log output in real-time?
-t
-d
-f
-r
In a Docker Compose setup, how can you link a service to another service's network without directly exposing its ports to the host?
It is not possible to achieve this; services must have ports exposed to the host for communication
By using the depends_on keyword and specifying the target service
depends_on
By using the expose keyword in the dependent service's configuration and listing the target service's ports
expose
By defining both services under the same custom network within the networks section
networks
In a GitHub Actions workflow, what is the purpose of the 'docker build' command?
To run automated tests inside a Docker container
To build a Docker image based on a Dockerfile
To push a pre-built Docker image to a registry
To download and install Docker on the runner machine
Which command is used to list all running Docker containers?
docker ps
docker start
docker run
docker images
What is a key benefit of using a private Docker Registry in a continuous integration/continuous deployment (CI/CD) pipeline?
It allows for easier public image discovery.
It eliminates the need for image version control.
It enables faster and more controlled image distribution within the pipeline.
It simplifies the process of building images from source code.
How can you invalidate the Docker build cache for a specific instruction?
By using the --no-cache flag during the build process.
--no-cache
By deleting the corresponding image layer.
All of the above.
By modifying the instruction itself.
What is a significant benefit of using a volume driver that supports cloud storage?
Improved performance for data-intensive applications.
Enhanced data durability and availability through redundancy and backups.
Increased complexity in managing data.
Reduced need for data backups and disaster recovery planning.