In Docker Compose, what is the primary function of environment variables?
To pass dynamic configuration values to services at runtime
To define the Docker image to be used for a service
To configure the network settings for services
To specify the build context for a service's Dockerfile
Which command is used to list all running Docker containers?
docker images
docker start
docker run
docker ps
What is the primary advantage of using multi-stage builds in Docker?
To enable parallel execution of build steps.
To simplify the process of building complex applications.
To improve network performance during the build process.
To reduce the size of the final Docker image.
What is the purpose of the COPY --from instruction in a multi-stage Docker build?
COPY --from
To copy files from the host machine to the current build stage.
To copy files from the current build stage to a later build stage.
To copy files from a remote repository to the current build stage.
To copy files from a previous build stage to the current build stage.
How does Docker optimize build cache for the RUN instruction?
RUN
It caches the result of each individual command within a RUN instruction.
It does not cache the results of RUN instructions.
It caches the entire file system state after each RUN instruction.
It only caches the output of the RUN command if it has changed.
What is the primary way to define and deploy applications in a Docker Swarm?
Docker Swarm stacks
Dockerfiles
Docker Compose files
Kubernetes Deployments
What is a key advantage of using Docker with Jenkins for deployments?
Docker automatically scales applications based on real-time traffic
Docker handles database migrations as part of the deployment process
Docker enables immutable deployments, ensuring consistent application versions across environments
Docker eliminates the need for orchestration tools like Kubernetes
How do you retrieve the IP address of a running Docker container using 'docker inspect'?
docker inspect <container_name> | find 'IP'
docker inspect <container_name> | grep IPAddress
docker inspect -f '{{.NetworkSettings.IPAddress}}' <container_name>
docker inspect <container_name> --format IP
Which flag is used with 'docker logs' to follow log output in real-time?
-t
-r
-d
-f
What is the purpose of a replica in the context of Docker Swarm services?
A copy of a Docker image stored on a different node
A load balancer that distributes traffic across multiple containers
An instance of a container running a specific task for a service
A backup of a manager node to ensure high availability