How to run docker-compose in detached mode or in the background?
A. Use –daemon flag with docker-compose up command.
B. Use -d option with docker-compose up command.
C. Use docker-compose run –background command.
B. Use -d option with docker-compose up command.
Which commands can be used instead of docker-compose up?
A. docker-compose build and docker-compose start.
B. docker-compose build and docker-compose run.
C. docker-compose start and docker-compose run.
(docker-compose start will start pre-built containers only.)
B. docker-compose build and docker-compose run.
(docker-compose start will start pre-built containers only.)
Select all the options which applies to the Docker Swarm.
(This is a multi answer question. You can select one or more options as the answer.)
A. A container orchestration tool.
B. A tool from Docker to work with distributed deployments of containers.
C. A cluster of Docker hosts.
A, B, C
What is the right command to scale down a service running with 6 containers to 3
containers?
A. docker service <service_id> scale down 3.</service_id>
B. docker service scale <service_id>=3.</service_id>
C. docker services scale <service_id>=3.</service_id>
D. docker service <service_id> scale=3.</service_id>
B. docker service scale <service_id>=3.</service_id>
Q5: Select all the options which can be used to provide environment variables to a container
in docker-compose.yml file.
(This is a multi answer question. You can select one or more options as the answer.)
A. - env_file.
B. - environment.
C. - env.
D. ENV.
A. - env_file.
B. - environment.
Q6: How to specify the location of the Dockerfile in case of multiple Dockerfiles or to use a
Dockerfile located in a different location??
A. Use context and dockerfile keywords under build section.
B. Use dockerfile option and provide absolute path to the dockerfile.
C. Use directory option under build section with dockerfile.
A. Use context and dockerfile keywords under build section.
What are microservices?
Microservices are an architectural approach to developing software applications as a collection of small, independent services
- they communicate with each other over a network
- They are designed to perform a specific business function each
- They can be developed, deployed and scaled individually.
What is docker compose?
Docker Compose is a tool for running multi-container applications on Docker defined using docker-compose.yml file. A Compose file is used to define how the one or more containers that make
up your application are configured. Compose files can be used to deploy
applications locally, or to the cloud
What is the fundamental role of the Raft consensus algorithm in a Docker Swarm cluster?
It is used exclusively by the manager nodes to manage the clusters state. Primary goal is to ensure that all the manager nodes maintain and indentical, consistent internal state of the swarm. Shared state is stored in a replicated log and includes
This ensures fault tolerence, as if a manager fails another one is ready to step into its place with an exact copy of the internal state at the time.
How does Docker Swarm handle the failure of a leader manager node? Describe the Process.
Using raft consensus algorithm new leader is elected.
makes swarm highly available.
Why does docker swarm recommend an odd number of managers nodes? How does this related to fault tolerence?
Recommends 3,5,7 to ensure Hight availability and prevent split brain scenarios during nework partitions, to ensure quorum. Quorum is min number of managers that must be available and agree on any change to the cluster state. (N/2 + 1) which can tolerate the loss of (N-1) / 2 managers. Prevents two groups from making conflicting decisions when network splits.
What are the benefits of dockercompose?
What are the key features of docker swarm?
Which commands can be used instead of docker-compose up to start the containers?
docker compose build
docker compose start
What is the cmd that can be used to scale a service running 6 containers to 3?
docker service scale = 3
Compare similarities and dissimilarities between the container and
virtual machine technologies.
Container: Small on disk space (MBs). Fast starting in seconds. Can be replicated more easily. More efficient. Can run 1000+ on a physical server. Software level virtualization.
VM: Large on disk space (GBs). Slower starting in minutes. Cannot be replicated easily. Less efficient. Can run 10+ on a physical server. Hardware and software level virtualization.
Which of the following tools can help you install Docker Engine on multiple virtual hosts?
a. Dockerfile
b. Docker-compose
c. Docker machine
d. Docker-swarm and Kubernetes
c) docker machine