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 pass dynamic configuration values to services at runtime
To configure the network settings for services
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.
What is the purpose of the 'docker push' command in the context of a Docker Registry?
Download an image from a registry
Upload an image to a registry
Build a Docker image from a Dockerfile
Run a Docker container from an image
How can Docker be utilized to speed up the build process in a CI/CD pipeline?
By directly deploying code changes to production without testing
By replacing the need for unit tests in the development process
By caching frequently used dependencies within Docker images
By automatically scaling the number of build servers based on load
You've scaled a service in Docker Compose, but now want to revert to a single instance. How do you achieve this?
Docker Compose automatically handles this, no manual intervention needed
Execute docker-compose restart <service_name>
docker-compose restart <service_name>
Use docker-compose down followed by docker-compose up
docker-compose down
docker-compose up
Utilize docker-compose scale <service_name>=1
docker-compose scale <service_name>=1
How can you invalidate the Docker build cache for a specific instruction?
By using the --no-cache flag during the build process.
--no-cache
All of the above.
By modifying the instruction itself.
By deleting the corresponding image layer.
In a GitHub Actions workflow, what is the purpose of the 'docker build' command?
To push a pre-built Docker image to a registry
To download and install Docker on the runner machine
To build a Docker image based on a Dockerfile
To run automated tests inside a Docker container
How can you control access to images stored in a private Docker Registry?
By using encryption to secure images during transmission
By implementing authentication and authorization mechanisms within the registry
By configuring network firewalls to restrict access by IP address
By regularly updating the registry software to patch vulnerabilities
What is a key benefit of using a private Docker Registry in a continuous integration/continuous deployment (CI/CD) pipeline?
It simplifies the process of building images from source code.
It eliminates the need for image version control.
It allows for easier public image discovery.
It enables faster and more controlled image distribution within the pipeline.
Which open-source tool is commonly used to set up a private Docker Registry?
Docker Hub
Docker Registry
Docker Compose
Kubernetes