Docker Certified Associate (DCA) Practice Tests Set 6

You want to take a node down for maintenance. Which command will drain a node that has tasks assigned to it?


Options are :

  • docker node update --availability drain (Correct)
  • docker node update --availability maintenance
  • docker task update drain
  • docker service update --availability drain

Answer :docker node update --availability drain

Docker Certified Associate (DCA) Practice Tests Set 10

Which flags for a service would allow a container to consume more than 2 GB of memory only when there is no memory contention but would also prevent a container from consuming more than 4GB of memory in any other case?


Options are :

  • --memory-swap 4GB --limit-memory 2GB
  • --memory-swap 2GB --limit-memory 4GB
  • --memory 4GB --memory-reservation 2GB (Correct)
  • --limit-memory 2GB --reserve-memory 4GB

Answer :--memory 4GB --memory-reservation 2GB

Which of the following commands can you use on a worker node to remove it from the swarm cluster gracefully?


Options are :

  • docker swarm leave (Correct)
  • docker swarm exit
  • docker node rm worker
  • docker leave swarm

Answer :docker swarm leave

Which of the following docker commands can you use to add or update a placement constraint?


Options are :

  • docker service update --constraint-add (Correct)
  • docker service update --pref-add
  • docker service update --placement-pref-add
  • docker service update --placement-constraint-add

Answer :docker service update --constraint-add

Docker and Containers: Commands Set 2

Which of the following is false about the docker consensus algorithm, Raft?


Options are :

  • If a quorum is not reached, the existing tasks will keep running
  • If a quorum is not reached, the system will not process any more requests to schedule additional tasks
  • Raft requires a majority or quorum of (N/2) + 1 members
  • Raft tolerates up to (N-2)/2 failures (Correct)

Answer :Raft tolerates up to (N-2)/2 failures

Which of the following scenarios will cause a swarm cluster to be in a lost quorum state?


Options are :

  • 1 manager of which 1 is healthy.
  • 4 managers of which 2 are healthy. (Correct)
  • 5 managers of which 3 are healthy.
  • 3 managers of which 2 are healthy.

Answer :4 managers of which 2 are healthy.

What docker command can you use to add a network to an existing service?


Options are :

  • docker service set --add-network
  • docker service add-network
  • docker service update --network-add (Correct)
  • docker service modify --add-network

Answer :docker service update --network-add

Docker Certified Associate (DCA) Practice Exams Set 27

When a container starts, it can be connected to multiple networks using --network. True or false?


Options are :

  • FALSE (Correct)
  • TRUE

Answer :FALSE

Which of the following flags is used to publish containers port(s) on an existing service in the swarm?


Options are :

  • --publish-add (Correct)
  • --publish
  • -p
  • --publish-all

Answer :--publish-add

What behavior is expected when a service is created with the following command: docker service create --publish 8080:80 nginx?


Options are :

  • All nodes in the cluster will listen on port 8080 and forward to port 80 in the container. (Correct)
  • Only a single node in the cluster will listen on port 80 and forward to port 8080 in the container.
  • Only a single node in the cluster will listen on port 8080 and forward to port 80 in the container.
  • All nodes in the cluster will listen on port 80 and forward to port 8080 in the container.

Answer :All nodes in the cluster will listen on port 8080 and forward to port 80 in the container.

Docker Certified Associate (DCA) Practice Tests Set 10

Which of the following commands configures a Redis container to always restart unless it is explicitly stopped or Docker is restarted?


Options are :

  • docker run -d --restart unless-stopped redis (Correct)
  • docker run -d --restart omit-stopped redis
  • docker run -d --restart-policy unless-stopped redis
  • docker run -d --failure omit-stopped redis

Answer :docker run -d --restart unless-stopped redis

What flag can you configure to a service to introduces a delay between tasks, so that the rolling restart happens gradually?


Options are :

  • --update-pause
  • --update-delay (Correct)
  • -update-wait
  • --wait-delay

Answer :--update-delay

How can you see the information logged by a running container called "web"?


Options are :

  • docker log inspect web
  • docker container logs web (Correct)
  • docker logs web (Correct)
  • docker logview web

Answer :docker container logs web docker logs web

Docker Certified Associate (DCA) Practice Test Set 4

You have received a docker service inspect report that appears to be formatted as one big json. What option can you use in order to clean up the format into something more readable?


Options are :

  • --readable
  • --human
  • --pretty (Correct)
  • --format="{?{.Structure.To.Review}}"

Answer :--pretty

Which of the following commands can you use to list the tasks of one or more services in swarm?


Options are :

  • docker services
  • docker ps
  • docker service ls
  • docker service ps (Correct)

Answer :docker service ps

Which of the following mechanisms can you use to place services evenly on appropriate nodes in a swarm cluster?


Options are :

  • Placement Preference (Correct)
  • Replicated Mode
  • Placement Constraint
  • Routing Mesh

Answer :Placement Preference

Docker Certified Associate (DCA) Practice Test Set 5

What is the limitation of docker service scale command in swarm mode?


Options are :

  • It can only scale UP the service.
  • It can only be applied on replicated services. (Correct)
  • It can only scale one service at a time.
  • All answers are true.

Answer :It can only be applied on replicated services.

Which of the following commands can you use to restart a docker container automatically, if the container exits due to an error, which manifests as a non-zero exit code?


Options are :

  • docker run --restart no nginx
  • docker run --restart failure-only nginx
  • docker run --restart unless-stopped nginx
  • docker run --restart on-failure nginx (Correct)

Answer :docker run --restart on-failure nginx

What is the docker command to set the number of replicas for a service called "web" to 5?


Options are :

  • docker service increase web=5
  • docker service replica web=5
  • docker service build web=5
  • docker service scale web=5 (Correct)

Answer :docker service scale web=5

Docker Certified Associate (DCA) Practice Exams Set 8

You want to use a secret as an environment variable in the Pod definition. Where should you place the secret's name and key?


Options are :

  • None of the answers is correct.
  • env[].valueFrom.secret
  • env[].valueFrom.secretKeyRef (Correct)
  • env[].secret

Answer :env[].valueFrom.secretKeyRef

Which of the following units of the swarm can instruct a worker node to run a task?


Options are :

  • Dispatcher
  • Orchestrator
  • Allocator
  • Scheduler (Correct)

Answer :Scheduler

Which of the following flags is not supported by docker service create command?


Options are :

  • -v (Correct)
  • -t
  • -p
  • -l

Answer :-v

Docker Certified Associate (DCA) Practice Test Set 4

Which of the following options allow you to scale an app? (select two)


Options are :

  • Setting the app to the global mode.
  • Execute the 'docker stack deploy' command (Correct)
  • Enable autoscaling
  • Change the replicas value in the docker-compose.yml file (Correct)

Answer :Execute the 'docker stack deploy' command Change the replicas value in the docker-compose.yml file

Which of the following commands can you use to exclude the manager node from running the tasks of a service?


Options are :

  • docker node update drain manager
  • docker update node --availability drain manager
  • docker node stop manager
  • docker node update --availability drain manager (Correct)

Answer :docker node update --availability drain manager

Chris wants to execute an application job using a Docker container. However, occasionally, this job fails and needs to be restarted. Chris doesn't want to restart it manually if it fails. Which command should he use to make sure that the container restarts automatically?


Options are :

  • docker run --restart unless-stopped app
  • docker run --restart on-failure app (Correct)
  • docker run --recover-failure app
  • docker run --restart failure-only app

Answer :docker run --restart on-failure app

Docker Certified Associate 2020 - Practice Exams - NEW Set 8

What is the docker command to update an existing service?


Options are :

  • docker service config
  • docker service modify
  • docker service update (Correct)
  • docker service change

Answer :docker service update

A task is a unidirectional mechanism. True or False?


Options are :

  • TRUE (Correct)
  • FALSE

Answer :TRUE

Which of the following are valid ways to reference a secret from a Pod? (Select all that apply)


Options are :

  • By the kubelet when pulling images for the Pod. (Correct)
  • As files in a volume mounted on one or more of its containers. (Correct)
  • As container environment variable. (Correct)
  • As ConfigMaps.

Answer :By the kubelet when pulling images for the Pod. As files in a volume mounted on one or more of its containers. As container environment variable.

Docker Certified Associate (DCA) Practice Exams Set 13

Paul has some containerized software that needs to reference the hostname of the node that the software is running on.

Which of the following commands can Paul use to pass the hostname, as an environment variable, into each task in a service?


Options are :

  • docker service create --env NODE_HOSTNAME="{?{.Node.Hostname}}" nginx (Correct)
  • docker service create --env NODE_HOSTNAME="{?{Hostname}}" nginx
  • docker service create --pass-node-hostname=true nginx
  • docker service create -e NODE_HOSTNAME nginx

Answer :docker service create --env NODE_HOSTNAME="{?{.Node.Hostname}}" nginx

One of the nodes in your existing cluster is logging errors related to the storage subsystem and it needs to be taken offline. Which command will allow you to gracefully remove the node when executed on the node itself?


Options are :

  • docker swarm rm
  • docker swarm leave --gracefully
  • docker swarm leave (Correct)
  • docker swarm unregister

Answer :docker swarm leave

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions