Docker Certified Associate (DCA) Practice Exams Set 12

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


Options are :

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

Answer : docker service update --constraint-add

What is the docker command to add or update a placement constraint?


Options are :

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

Answer : docker service update --constraint-add

Which of the following is NOT how to create an efficient image via a Dockerfile?


Options are :

  • Use multi-stage builds
  • Combine multiple applications into a single container
  • Avoid installing unnecessary packages
  • Start with an appropriate base image

Answer : Combine multiple applications into a single container

Docker Certified Associate (DCA) Practice Exams Set 15

Which of the following docker image commands display detailed information on one or more images?


Options are :

  • docker image inspect
  • docker image ls
  • docker image history
  • docker image detai

Answer : docker image inspect

Which of the Dockerfile options executes any commands in a new layer on top of the current image and commit the results?


Options are :

  • FROM
  • ONBUILD
  • CMD
  • RUN

Answer : RUN

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


Options are :

  • FROM
  • ONBUILD
  • CMD
  • RUN

Answer : FROM

Docker Certified Associate (DCA) Practice Exams Set 9

What docker image prune command does?


Options are :

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

Answer : Remove unused images

What does docker image rm command do?


Options are :

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

Answer : Remove one or more images

Which?? command ??is?? used?? to? ?place ??an ??image?? into?? a?? registry?


Options are :

  • docker commit
  • docker tag
  • docker push
  • docker images
  • docker pull

Answer : docker push

Docker Certified Associate (DCA) Practice Exams Set 9

Which ??network ??allows ??Docker?? Trusted?? Registry ??components?? running ??on?? different?? nodes ??to communicate ??and ??replicate?? Docker?? Trusted?? Registry?? data?


Options are :

  • dtr-ol
  • dtr-hosts
  • dtr-br
  • dtr-vlan

Answer : dtr-ol

After creating a new service names 'http", you notice that the new service is not registering as healthy. How do you view the list of historical tasks for that service by using the command line ?


Options are :

  • docker inspect http'
  • docker servoce inspect http'
  • docker service ps http'
  • docker ps http'

Answer : docker service ps http'

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


Options are :

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

Answer : docker info

Docker Certified Associate (DCA) Practice Exams Set 5

Following the principle of least privilege, which of the following methods can be used to securely grant acess to the specific use to communicate to a Docker engine? (select two)


Options are :

  • Utilize the '--host0.0.0.0:2375' option to the Docker daemon to listen on port 2375 over TCP on all interfaces
  • Utilize openssl to create TLS client and server certificates, configuring the Docker engine to use with mutual TLS over TCP
  • Utilize the '--host 127.0.0.1:2375' option to the Docker daemon to listen on port 2375 over TCP on localhsot
  • Give the user root access to the server to allow them to run Docker commands as root
  • Add the use to the 'doker' group ont he server or specify the group with the '--group' Docker daemon option

Answer : Utilize openssl to create TLS client and server certificates, configuring the Docker engine to use with mutual TLS over TCP Add the use to the 'doker' group ont he server or specify the group with the '--group' Docker daemon option

Which of the following is supported by control group ?


Options are :

  • Manage certificate
  • Collect net
  • Limit CPU usage within a container
  • Isolate processess in a container

Answer : Limit CPU usage within a container

In a Docker Trusted Registry, how would a user prevent an image, for examle 'nginx:latest' from being overwritten by another user with push access to the repository ?


Options are :

  • Tag the image with 'nginx:immutable'
  • Remive push access from all other users
  • User the DTR web UI to make the tag immutable
  • Keep a backup copy of the image on another repository

Answer : User the DTR web UI to make the tag immutable

Docker Certified Associate (DCA) Practice Exams Set 10

Which of the following is supported by control groups?


Options are :

  • Manage certificates
  • Collect net
  • Limit CPU usage within acontainer
  • Isolate processes in acontainer

Answer : Limit CPU usage within acontainer

What is the purpose of Dockers Content Trust?


Options are :

  • Signing and verification of image tags
  • Enabling mutual TLS between the Dockers client and server
  • Dockers registry TLS verification and encryption
  • Indicating an image on DockersHub is an officialimage

Answer : Signing and verification of image tags

What is the purpose of a client bundle in the Universal Control Plane?


Options are :

  • Authenticate a user using client certificates to the Universal Control Plane
  • Provide a new user instructions for how to login to the Universal Control Plane
  • Provide a user with a Dockers client binary compatible with the Universal Control Plane
  • Group multiple users in a team in the Universal Control Plane

Answer : Authenticate a user using client certificates to the Universal Control Plane

Docker Certified Associate (DCA) Practice Exams Set 8

When using the Dockersclient to push an image to a registry, what environment variable is used to instruct the client to perform signing of the image?


Options are :

  • DOCKER_CONTENT_TRUST=1
  • DOCKER_IMAGE_SIGN=1
  • DOCKER_PUSH_SIGN=1
  • NOTARY_ENABLE=1 Correct

Answer : DOCKER_CONTENT_TRUST=1

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


Options are :

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

Answer : Use network connect to access the containers on the bridgenetwork

Which of these swarm manager configurations will cause the cluster to be in a lost quorum state?


Options are :

  • 4 managers of which 2 are healthy
  • 1 manager of which 1 is healthy
  • 3 managers of which 2 are healthy
  • 5 managers of which 3 are healthy

Answer : 4 managers of which 2 are healthy

Docker Certified Associate (DCA) Practice Exams Set 9

Which of the following commands starts a Redid container and configures it to always restart unless it is explicitly stopped or Dockers is restarted?


Options are :

  • docker run -d --restart-policy unless-stopped redid'
  • docker run -d --restart omit-stopped redis'
  • docker run -d --restart unless-stopped redis'
  • docker run -d --failure omit-stopped redis'

Answer : docker run -d --restart-policy unless-stopped redid'

After creating a new service named 'http', you notice that the new service is not registering as healthy. How do you view the list of historical tasks for that service by using the command line?


Options are :

  • docker inspect http'
  • docker service inspect http'
  • docker service ps http'
  • docker ps http'

Answer : docker service inspect http'

Which flag 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 case?


Options are :

  • --limit-memory 2GB --reserve-memory 4GB
  • --limit-memory 4GB --reserve-memory 2GB
  • --memory-swap 2GB --limit-memory 4GB
  • --memory-swap 4GB --limit-memory 2GB

Answer : --limit-memory 4GB --reserve-memory 2GB

Docker Certified Associate (DCA) Practice Exams Set 8

Which ??of ??the?? following?? is?? not?? an ??endpoint ??exposed?? by?? Docker?? Trusted?? Registry?? that?? can ??be used?? to?? assess?? the ??health?? of ??a ??Docker?? Trusted ??Registry ??replica?


Options are :

  • /health
  • /nginx_status
  • /api/v0/meta/cluster_status
  • /replica_status

Answer : /replica_status

Which?? of ??th e??following ??endpoints ??exposed ??by ??Docker?? Trusted ??Registry?? can?? be? ?used ??to assess ??the ??health ??of ??a ??Docker ??Trusted ??Registry ??replica?


Options are :

  • /health
  • /api/health
  • /replica_status
  • /nginx/health

Answer : /health

One?? of ??your ??developers ??is ??trying ??to ??push ??an ??image ??to ??the ??registry? ?(dtr.example.com).??The push ??fails ??with ??the ??error?? “denied :? ?requested? ?access ??to ??the ??resource ??is? ?denied”.??What ??should ??you verify ??the ??user ??has ??completed?


Options are :

  • docker login -u -p dtr.example.com
  • docker registry login -u username -p dtr.example.com
  • docker push / dtr.example.com
  • docker images login -u -p dtr.example.com

Answer : docker login -u -p dtr.example.com

Docker Certified Associate (DCA) Practice Exams Set 6

Which command is used to place an image into a registry?


Options are :

  • docker commit
  • docker tag
  • docker push
  • docker images
  • docker pull

Answer : docker push

Which network allows Docker Trusted Registry components running on different nodes to communicate and replicate Docker Trusted Registry data?


Options are :

  • dtr-ol
  • dtr-hosts
  • dtr-br
  • dtr-vlan

Answer : dtr-ol

Which of the following is not an endpoint exposed by Docker Trusted Registry that can be used to assess the health of a Docker Trusted Registry replica?


Options are :

  • /health
  • /nginx_status
  • /api/v0/meta/cluster_status
  • replica_status

Answer : replica_status

Docker Certified Associate (DCA) Practice Exams Set 16

Which of the following endpoints exposed by Docker Trusted Registry can be used to assess the health of a Docker Trusted Registry replica?


Options are :

  • /health
  • /api/health
  • /replica_status
  • /nginx/health

Answer : /health

You have been asked to backup the swarm state on a Linux installation. By default, where do Docker manager nodes store the swarm state and manager logs?


Options are :

  • /var/run/docker/swarm
  • /var/lib/docker/swarm
  • /etc/docker/swarm
  • /run/docker/swarm

Answer : /var/lib/docker/swarm

Which of the following will put the Docker engine into debug mode?


Options are :

  • echo '{"debug": true}' > /var/lib/docker/daemon.json ; sudo kill -HUP
  • echo '{"debug": true}' > /etc/docker/config.json ; sudo kill -HUP
  • echo '{"debug": true}' > /var/lib/docker/config.json ; sudo kill -HUP
  • echo '{"debug": true}' > /etc/docker/daemon.json ; sudo kill -HUP

Answer : echo '{"debug": true}' > /etc/docker/daemon.json ; sudo kill -HUP

Docker Certified Associate (DCA) Practice Exams Set 8

How do you deploy 4 new instances of nginx with a single command?


Options are :

  • docker service create --replicas 4 --name myservice nginx
  • docker service create --instances 4 --name myservice nginx
  • docker service scale myservice=4 nginx
  • docker service scale --replicas 4 --name myservice nginx

Answer : docker service create --replicas 4 --name myservice nginx

You are using self-signed UCP certs and have a second DNS name that points to your internal controllers. When installing UCP, which flag should you use to add this additional name?


Options are :

  • --internal-server-cert
  • --dns
  • --san
  • -external-server-cert

Answer : --san

Which of the following commands will provide a list of all Docker networks and their drivers currently configured on the Docker host? Choose the correct answer:


Options are :

  • docker system --list-networks
  • docker network ls
  • docker info --networks
  • docker system inspect networks

Answer : docker network ls

Docker Certified Associate (DCA) Practice Exams Set 26

Which of the following resource limitation options, when added to a container instantiation, is representative of a 'Control Group (cgroup)?(Choose all that apply) Choose the 2 correct answers:


Options are :

  • --memory=[amount b/k/m/g]
  • -end=[#]
  • --limit=[#]
  • --cpus=[value]

Answer : --memory=[amount b/k/m/g] --cpus=[value]

Which of the following Docker client commands will display all of the base images available for local containers to be instantiated from? Choose the correct answer:


Options are :

  • docker list
  • docker images
  • docker list all
  • None of the above.

Answer : docker images

You have received a 'docker inspect' report that appears to be formatted as one long line. What option can you instruct your staff to use next time in order to clean up the format into something more readable? Choose the correct answer:


Options are :

  • --format="{?{.Structure.To.Review}}" [objectid/name]
  • --readable
  • --human
  • --pretty

Answer : --format="{?{.Structure.To.Review}}" [objectid/name]

Docker Certified Associate (DCA) Practice Exams Set 15

When querying the configuration of a running container called 'myweb', which command would display the container's IP Address?


Options are :

  • docker run inspect myweb | grep IP
  • docker myweb inspect | grep IP
  • docker inspect myweb | grep IPAddress
  • None of the Above

Answer : docker inspect myweb | grep IPAddress

When instantiating a docker container called 'myweb' that is running an Apache web server on port 80 by default within it, you can allow direct access to the container service via the host's IP by redirecting the container port 80 to the host port 80. Which command will accomplish this? Choose the correct answer:


Options are :

  • docker run --name myweb -P 80/80 httpd/latest
  • docker run -d --name myweb -P 80 httpd:latest
  • docker run -d --name myweb -p 80:80 httpd:latest
  • None of the above.

Answer : docker run -d --name myweb -p 80:80 httpd:latest

Recent problems with the service called 'my_api' in your cluster has caused your development team to request its removal from the cluster while they address the problems. Which command will you need to execute to remove it? Choose the correct answer:


Options are :

  • docker swarm --remove=my_api
  • docker rm my_api
  • docker swarm remove my_api
  • docker service rm my_api

Answer : docker service rm my_api

Docker Certified Associate (DCA) Practice Exams Set 7

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


Options are :

  • docker swarm unregister
  • docker swarm leave
  • docker swarm rm
  • None of the above

Answer : docker swarm leave

Which Docker command is used to remove a base image, even if that image has containers that are based on it?


Options are :

  • docker rmi [image name] --force
  • docker rm [image name] --force
  • docker remove [image name]
  • None of the above.

Answer : docker rmi [image name] --force

If you want an instantiated container named 'myweb' to have a path inside of it called '/my/data/volume', which command would accomplish this?


Options are :

  • docker run -d --name myweb -v /local/dir:/my/data/volume httpd:latest
  • docker run -d --name myweb --volumes /local/dir:/my/data/volume httpd:latest
  • docker run -d --name myweb -V /my/data/volume httpd:latest
  • None of the above.

Answer : docker run -d --name myweb -V /my/data/volume httpd:latest

Docker Certified Associate (DCA) Practice Exams Set 9

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions
  • If you want an instantiated container named 'myweb' to have a path inside of it called '/my/data/volume', which command would accomplish this?
    
    Options are :
    
    docker run -d --name myweb -v /local/dir:/my/data/volume httpd:latest  <---------------- this should be the correct answer
    docker run -d --name myweb --volumes /local/dir:/my/data/volume httpd:latest
    docker run -d --name myweb -V /my/data/volume httpd:latest
    None of the above.
    Reply
  • User
    You have received a 'docker inspect' report that appears to be formatted as one long line. What option can you instruct your staff to use next time in order to clean up the format into something more readable? Choose the correct answer:
    
    Options are :
    
    --format="{?{.Structure.To.Review}}" [objectid/name]
    --readable
    --human
    --pretty --> I think this is the good answer (https://docs.docker.com/engine/reference/commandline/service_inspect/#options)
    Reply
  • User
    What is the docker command to add a network to a service?
    
    Options are :
    
    docker service update --constraint-add
    docker service update --network-add --> good answer
    docker service modify --add-network
    docker service set --add-network
    Answer : docker service update --constraint-add
    Reply