Which command is used to download a Docker image from a registry?
docker push
docker build
docker pull
docker run
How do you specify the Docker image to be used for a service in 'docker-compose.yml'?
container:
build:
from:
image:
Which Docker network driver allows a container to share the host's network stack, effectively making it appear as if the container's processes are running directly on the host?
Host
Macvlan
Bridge
Overlay
What does the COPY instruction do in a Dockerfile?
COPY
Sets the working directory for subsequent instructions.
Executes a command within the Docker image.
Exposes a port from the container to the host.
Copies files or directories from the host machine to the image.
In a 'docker-compose.yml' file, what is the keyword used to define a service?
service
app
image
container
Which Docker Compose command is used to start services in the background?
docker-compose up -d
docker-compose start
docker-compose up
docker-compose run
What is a potential drawback of using the 'host' network mode in Docker?
Increased network overhead due to network address translation (NAT)
Limited network performance due to sharing the host's network bandwidth
Reduced security as the container can access all ports and resources on the host
Increased complexity in configuring network settings for the container
What is the primary purpose of Docker Compose?
Defining and managing multi-container Docker applications
Building individual Docker images
Deploying Docker containers to production servers
Storing Docker images in a central repository
When should you consider using the 'host' network mode for a Docker container?
When you need to run a network monitoring tool inside the container
When you need to expose multiple ports from the container
When you want to connect the container to a specific VLAN on the host
When you want to limit the container's network access for security reasons
What is the purpose of the 'ports:' section in a Docker Compose service definition?
Map ports from the container to the host machine
Specify the network to which the service connects
Define environment variables for the service
Mount volumes from the host machine to the container