Which command is used to initialize a Docker Swarm?
docker swarm start
docker swarm init
docker swarm up
docker swarm create
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>
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
What is a key advantage of using Docker with Jenkins for deployments?
Docker automatically scales applications based on real-time traffic
Docker enables immutable deployments, ensuring consistent application versions across environments
Docker eliminates the need for orchestration tools like Kubernetes
Docker handles database migrations as part of the deployment process
Which of the following is a key characteristic of bind mounts in Docker?
They are stored within the Docker's internal storage system.
They directly link a directory on the host machine to a container's filesystem.
They are the preferred method for managing sensitive data within Docker containers.
They provide a way to share data between containers.
What is the primary advantage of using Docker containers in a CI/CD pipeline?
Elimination of the need for version control
Reduced storage footprint for build artifacts
Enhanced environment consistency across development, testing, and production
Guaranteed execution on any operating system
When scaling a service with Docker Compose, what happens to data stored within the container's writable layer?
Data is automatically replicated across all instances of the scaled service
Data is persisted only in the original container instance; scaled instances have their own independent data
Docker Compose automatically creates a shared volume for the scaled service, ensuring data consistency
Scaling a service with data persistence requires manual configuration of shared volumes or external data stores
What is the purpose of volume drivers in Docker?
To enable the use of remote storage or cloud-based solutions for volumes.
To improve the performance of volume operations.
To restrict container access to specific volumes.
To manage the lifecycle of bind mounts.
Which Dockerfile instruction is used to define a health check for a container?
HEALTHCHECK
CHECK
RUN
EXPOSE
Which of the following is NOT a valid health check type in a Dockerfile?
CMD
HTTP
NONE
TCP
How can you control access to images stored in a private Docker Registry?
By using encryption to secure images during transmission
By configuring network firewalls to restrict access by IP address
By implementing authentication and authorization mechanisms within the registry
By regularly updating the registry software to patch vulnerabilities