You've scaled a service in Docker Compose, but now want to revert to a single instance. How do you achieve this?
Utilize docker-compose scale <service_name>=1
docker-compose scale <service_name>=1
Use docker-compose down followed by docker-compose up
docker-compose down
docker-compose up
Docker Compose automatically handles this, no manual intervention needed
Execute docker-compose restart <service_name>
docker-compose restart <service_name>
What role does a manager node play in a Docker Swarm cluster?
Manages cluster state, schedules tasks, and ensures service availability
Executes the actual application tasks within containers
Stores and distributes Docker images to worker nodes
Provides networking and load balancing for the cluster
What is the primary advantage of using multi-stage builds in Docker?
To simplify the process of building complex applications.
To improve network performance during the build process.
To enable parallel execution of build steps.
To reduce the size of the final Docker image.
In a multi-stage Docker build, how can you refer to a specific stage by its index?
By using the stage's name.
It's not possible to refer to stages by index.
By using a numerical index starting from 0.
By using a numerical index starting from 1.
What is the purpose of volume drivers in Docker?
To restrict container access to specific volumes.
To enable the use of remote storage or cloud-based solutions for volumes.
To improve the performance of volume operations.
To manage the lifecycle of bind mounts.
How can you view the logs of a specific container named 'webserver'?
docker logs -id webserver
docker inspect webserver | grep logs
docker logs webserver
docker show-logs webserver
You want to execute 'ls -l' inside a container named 'app-server' and allocate a pseudo-TTY. Which command is correct?
docker run -it app-server ls -l
docker exec -it app-server ls -l
docker exec app-server -it ls -l
docker exec -d app-server ls -l
How does Docker Swarm achieve network communication between containers on different nodes?
By creating a single, shared network interface for all containers
By establishing secure tunnels between individual containers
By creating an overlay network that spans across all nodes in the cluster
By relying on the host operating system's networking capabilities
What is a key advantage of using Docker with Jenkins for deployments?
Docker eliminates the need for orchestration tools like Kubernetes
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
What information does the 'docker inspect' command provide?
A list of all environment variables in a container
The status (running/stopped) of a container
Low-level information about a container, image, or network
Real-time resource usage of a running container