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.
What is the primary advantage of using multi-stage builds in Docker?
To enable parallel execution of build steps.
To reduce the size of the final Docker image.
To improve network performance during the build process.
To simplify the process of building complex applications.
How does Docker integrate with GitLab CI for automated testing?
GitLab CI automatically generates Dockerfiles based on project code
Docker replaces the need for a separate testing framework
Docker directly executes test suites within the GitLab CI/CD platform
GitLab CI can use Docker images to provide isolated environments for running tests
What is a key benefit of using a private Docker Registry in a continuous integration/continuous deployment (CI/CD) pipeline?
It enables faster and more controlled image distribution within the pipeline.
It allows for easier public image discovery.
It simplifies the process of building images from source code.
It eliminates the need for image version control.
What is the primary way to define and deploy applications in a Docker Swarm?
Dockerfiles
Docker Compose files
Docker Swarm stacks
Kubernetes Deployments
What is the role of a Docker registry in a CI/CD pipeline?
To define the steps of the continuous integration process
To store and manage Docker images
To execute automated tests within isolated containers
To monitor application performance in real-time
When might a bind mount be a suitable choice for data persistence in Docker?
When you want to leverage the scalability and redundancy of cloud storage.
When you need to share sensitive configuration files between the host and a container.
When you require data portability across different Docker environments.
When you need to share data between multiple Docker containers running on the same host.
What is a significant benefit of using a volume driver that supports cloud storage?
Enhanced data durability and availability through redundancy and backups.
Reduced need for data backups and disaster recovery planning.
Improved performance for data-intensive applications.
Increased complexity in managing data.
Which command is used to initialize a Docker Swarm?
docker swarm create
docker swarm init
docker swarm up
docker swarm start
In a GitHub Actions workflow, what is the purpose of the 'docker build' command?
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
To run automated tests inside a Docker container