Docker Certified Associate (DCA) Practice Exams Set 17

Which one of the following commands will show a list of volumes for a specific container?


Options are :

  • docker container inspect nginx'
  • docker volume logs nginx --containers'
  • docker volume inspect nginx'
  • docker container logs nginx --volumes'

Answer : docker container inspect nginx'

Docker Certified Associate (DCA) Practice Exams Set 10

You have deployed a service to swarm. Which command uses the Docker CLI to set the number of tasks of the services to 5? (choose 2)


Options are :

  • docker replica update =5'
  • docker service replicas =5'
  • docker update service =5'
  • docker service update --replicas=5 '
  • docker service scale = 5''

Answer : docker service update --replicas=5 ' docker service scale = 5''

Which of the following commands will ensure that overlay traffic between service tasks is encrypted?


Options are :

  • docker network create -d overlay -o encrypted=true
  • docker network create -d overlay --secure
  • docker service create --network --secure
  • docker service create --network --encrypted

Answer : docker network create -d overlay -o encrypted=true

You have created a Docker bridge network on a host with three containers attached, how do you make this containers accessible outside of the host?


Options are :

  • Use --link to access the containers on the bridge network
  • Use either EXPOSE or --publish to access the containers on the bridge network
  • Use network connect to access the containers on the bridge network
  • Use network attach to access the containers on the bridge network

Answer : Use either EXPOSE or --publish to access the containers on the bridge network

Docker Certified Associate (DCA) Practice Exams Set 12

Which of the following namespaces is disabled by default and must be enabled at Docker engine runtime in order to be used?


Options are :

  • net
  • user
  • pid
  • mnt

Answer : user

Which of the following commands is used to display system-wide Docker configuration on a host?


Options are :

  • docker inspect
  • docker system
  • docker info
  • docker status

Answer : docker info

What is the difference between a replicated and a global service?


Options are :

  • Replicated service can only be deployed on manager node. Global service can be deployed on both manager and worker node.
  • Number of identical tasks can be specified for a replicated service. There is no pre-specified number of tasks for global service.
  • Replicated service runs one task on every node. Global service runs multiple task on every node.
  • Good candidates for replicated service are monitoring agents that you want to run on every node in the swarm. Good candidates for global service are http servers.

Answer : Number of identical tasks can be specified for a replicated service. There is no pre-specified number of tasks for global service.

Docker Certified Associate (DCA) Practice Tests Set 7

What is the purpose of multi-stage builds?


Options are :

  • Better logical separation of Dockerfile instructions for better readability
  • Faster image builds by allowing parallel execution of Docker builds
  • Better caching when building Docker images
  • Optimizing images by copying artifacts selectively from previous stages

Answer : Optimizing images by copying artifacts selectively from previous stages

What does docker image rm command do?


Options are :

  • Display detailed information on one or more images
  • Remove one or more images
  • Remove unused images
  • Show the history of an image

Answer : Remove one or more images

Which of the following commands will create a swarm service which only listens on port 53 using the UDP protocol?


Options are :

  • docker service create --name dns-cache -p 53:53 --service udp dns-cache
  • docker service create --name dns-cache -p 53:53 --udp dns-cache
  • docker service create --name dns-cache -p 53:53/udp dns-cache
  • docker service create --name dns-cache -p 53:53 --constraint networking-protocol-udp=true dns-cache

Answer : docker service create --name dns-cache -p 53:53/udp dns-cache

Docker Certified Associate (DCA) Practice Exams Set 8

The output of which command can be used to find the architecture and operating system an image is compatible with?


Options are :

  • docker image info
  • docker image inspect --format {?{.Architecture}} {?{.OS}} '
  • docker image inspect --filter {?{.Architecture}} {?{.OS}} '
  • docker image ls

Answer : docker image inspect --format {?{.Architecture}} {?{.OS}} '

What docker image prune command does?


Options are :

  • Remove one or more images
  • Show the history of an image
  • Display detailed information on one or more images
  • Remove unused images

Answer : Remove unused images

A host machine has four CPUs available and two running containers. The sysadmin would like to assign two CPUs to each container. Which of the following commands achieves this?


Options are :

  • Set the '--cpuset-cpus' flag of the 'dockerd' process to the value 'even-spread'
  • Set the '--cpu-quota' flag to '1.3' on one container and '2,4' on the other container.
  • Set the '--cpuset-cpus' flag to '.5' on both containers
  • Set the '--cpuset-cpu's flag to '1.3' on one container and '2.4' on the other container.

Answer : Set the '--cpuset-cpus' flag to '.5' on both containers

Docker Certified Associate (DCA) Practice Exams Set 20

What are the two types of docker swarm services?


Options are :

  • replicated and local services
  • replicated and global services
  • local and global services
  • distributed and replicated services

Answer : replicated and global services

Which of the following commands will ensure that overlay traffic between service tasks is encrypted?


Options are :

  • docker network create -d overlay -o encrypted=true
  • docker service create --network --secure
  • docker service create --network --encrypted
  • docker network create -d overlay --secure

Answer : docker network create -d overlay -o encrypted=true

Docker Certified Associate (DCA) Practice Exams Set 1

An application image runs in multiple environments, and each environment uses different certificates and ports, what is the best practice to deploy the containers?


Options are :

  • Create a Dockerfile for each environment, specifying ports and Docker secrets for certificates.
  • Create a Dockerfile for each environment, specifying ports and ENV variables for certificates.
  • Create a config file for each environment.
  • Create images that contain the specific configuration for every environment.

Answer : Create a config file for each environment.

Which of the following is true about using the '-P' option when creating a new container?


Options are :

  • Docker binds each exposed container port to a random port on all the host's interface.
  • Docker binds each exposed container port to a random port on a specified host interface.
  • Docker binds each exposed container port with the same port on the host.
  • Docker gives extended privileges to the container.

Answer : Docker binds each exposed container port to a random port on all the host's interface.

A server is running low on disk space. What command can be used to check the disk usage of images, containers, and volumes for Docker engine?


Options are :

  • 'docker system df'
  • 'docker system prune'
  • 'docker system ps'
  • 'docker system free'

Answer : 'docker system df'

Docker Certified Associate (DCA) Practice Tests Set 4

Which network driver type is best when you need multiple containers to communicate on the same Docker host? A.  B.  C.


Options are :

  • User-defined bridge networks
  • Host networks
  • Macvlan networks
  • Overlay networks

Answer : User-defined bridge networks

Which of the following commands will create a swarm service which only listens on port 53 using the UDP protocol?


Options are :

  • docker service create --name dns-cache -p 53:53 --service udp dns-cache
  • docker service create --name dns-cache -p 53:53/udp dns-cache
  • docker service create --name dns-cache -p 53:53 --udp dns-cache
  • docker service create --name dns-cache -p 53:53 --constraint networking-protocol-udp=true dns-cache

Answer : docker service create --name dns-cache -p 53:53/udp dns-cache

Which of the following is NOT true about Raft (docker consensus algorithm)? A. B.  C. D.


Options are :

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

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

Docker Certified Associate (DCA) Practice Tests Set 10

Which of the following statements is false?


Options are :

  • Containers can NOT be attached and detached from user-defined networks on the fly
  • User-defined bridges provide better isolation and interoperability between containerized applications
  • Linked containers on the default bridge network share environment variables
  • Each user-defined network creates a configurable bridge

Answer : Containers can NOT be attached and detached from user-defined networks on the fly

What is the docker command to add a network to a service?


Options are :

  • docker service add-network
  • docker service update --network-add
  • docker service set --add-network
  • docker service modify --add-network

Answer : docker service update --network-add

What are the two types of docker swarm services?


Options are :

  • replicated and global services
  • replicated and local services
  • distributed and replicated services
  • local and global services

Answer : replicated and global services

Docker Certified Associate (DCA) Practice Exams Set 2

What is the correct order to upgrade a Docker cluster?


Options are :

  • Upgrade engine and kernel, UCP, and then DTR
  • Upgrade UCP, DTR, then engine and kernel
  • Upgrade DTR, UCP, then engine and kernel
  • Upgrade engine and kernel, DTR, and then UCP

Answer : Upgrade engine and kernel, UCP, and then DTR

The output of which command can be used to find the architecture and operating system an image is compatible with?



Options are :

  • docker image ls
  • docker image inspect --filter {{.Architecture}} {{.OS}} '
  • docker image inspect --format {{.Architecture}} {{.OS}} '
  • docker image info

Answer : docker image inspect --format {{.Architecture}} {{.OS}} '

You have created a Docker bridge network on a host with three containers attached, how do you make this containers accessible outside of the host?


Options are :

  • Use --link to access the containers on the bridge network
  • Use network connect to access the containers on the bridge network
  • Use network attach to access the containers on the bridge network.
  • Use either EXPOSE or --publish to access the containers on the bridge network

Answer : Use either EXPOSE or --publish to access the containers on the bridge network

Docker Certified Associate (DCA) Practice Exams Set 25

A host machine has four CPUs available and two running containers. The sysadmin would like to assign two CPUs to each container. Which of the following commands achieves this?


Options are :

  • Set the '--cpuset-cpus' flag to '.5' on both containers
  • Set the '--cpuset-cpu's flag to '1.3' on one container and '2.4' on the other container.
  • Set the '--cpu-quota' flag to '1.3' on one container and '2,4' on the other container.
  • Set the '--cpuset-cpus' flag of the 'dockerd' process to the value 'even-spread'

Answer : Set the '--cpuset-cpus' flag to '.5' on both containers

Which of the Dockerfile options initializes a new build stage and sets the base image for subsequent instructions?


Options are :

  • ONBUILD
  • RUN
  • FROM
  • CMD

Answer : FROM

What is the docker command to connect a running container to an existing user-defined bridge?


Options are :

  • docker network join
  • docker network attach
  • docker connect network
  • docker network connect

Answer : docker network connect

Docker Certified Associate 2020 - Practice Exams - NEW Set 4

What Dockerfile option EXPOSE does?


Options are :

  • Expose defaults for an executing container
  • Adds metadata to an image
  • Label a container that will run as an executable
  • Informs Docker that the container listens on the specified network ports at runtime

Answer : Informs Docker that the container listens on the specified network ports at runtime

What is the docker command to update an existing service?


Options are :

  • docker service change
  • docker service modify
  • docker service update
  • docker service config

Answer : docker service update

Which of the following is NOT one of the 3 main Docker Container Network Model components?


Options are :

  • Endpoint
  • Routing
  • Network
  • Sandbox

Answer : Routing

Docker Certified Associate (DCA) Practice Exams Set 19

What is the docker command to add or update a published port?


Options are :

  • docker service update --publish-add
  • docker service modify --add-update-port
  • docker service update --publish-port
  • docker service set --add-port

Answer : docker service update --publish-add

What is the docker run option to publish a port so that an application is accessible externally?


Options are :

  • docker run --expose
  • docker run --publish
  • docker run --publish-port
  • docker run --open-port

Answer : docker run --publish

Which network driver type is best when you are migrating from a VM setup or need your containers to look like physical hosts on your network, each with a unique MAC address?


Options are :

  • Host networks
  • Macvlan networks
  • Overlay networks
  • User-defined bridge networks

Answer : Macvlan networks

Docker Certified Associate (DCA) Practice Exams Set 15

What is the recommended approach to set storage driver?


Options are :

  • Use --storage-driver flag when running dockerd
  • Set the "storage-driver" option in the daemon.json file

Answer : Set the "storage-driver" option in the daemon.json file

What is the docker command to increase number of replicas?


Options are :

  • docker service increase
  • docker service build
  • docker service scale
  • docker service replica

Answer : docker service scale

From a DevOps process standpoint, it is best practice to keep changes to an application in version control. Which of the following will allow changes to a docker Image to be stored in a version control system?


Options are :

  • docker save
  • A docker file
  • A docker-compose.yaml file
  • docker commit

Answer : docker commit

Docker Certified Associate (DCA) Practice Exams Set 21

What is the purpose of multi-stage builds?


Options are :

  • Optimizing images by copying artifacts selectively from previous stages
  • Better caching when building Docker images
  • Faster image builds by allowing parallel execution of Docker builds
  • Better logical separation of Dockerfile instructions for better readability

Answer : Optimizing images by copying artifacts selectively from previous stages

What is the docker command to add a node to a swarm?


Options are :

  • docker swarm join
  • docker swarm add-node
  • docker join swarm
  • docker swarm create-node

Answer : docker swarm join

What is the docker command to create a bridge network?


Options are :

  • docker network add
  • docker network create
  • docker network deploy
  • docker create network

Answer : docker network create

Docker Certified Associate (DCA) Practice Exams Set 15

What is the docker command to add a placement preference?


Options are :

  • docker service update --placement-constraint-add
  • docker service update --pref-add
  • docker service update --placement-pref-add
  • docker service update --constraint-add

Answer : docker service update --placement-pref-add

Which of the following are types of namespaces used by Docker to provide isolation? (Choose 2)


Options are :

  • Authentication
  • Network
  • Host
  • Storage
  • Process ID

Answer : Network Process ID

You have just executed 'docker swarm leave' on a node. What command can be run on the same node to confirm it has left the cluster?


Options are :

  • docker node ls
  • docker system info
  • docker system status
  • docker node status

Answer : docker system info

Docker Certified Associate (DCA) Practice Test Set 3

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions