Docker Certified Associate (DCA) Practice Exams Set 26

The following health check exists in a

Dockerfile: 'HEALTCHECK CMD curl --fail http://localhost/health || exit 1'

Which of the following describes its purpose?


Options are :

  • Defines the health check endpoint on the localhost interface for external monitoring tools to monitor the health of the docker engine.
  • Defines the action taken when container health fails, which in this case will kill the container with exit status 1
  • Defines the health check for the containerized application so that the application health can be monitored by the Docker engine
  • Defines the health check endpoint on the local host interface for containers to monitor the health of the docker engine

Answer : Defines the action taken when container health fails, which in this case will kill the container with exit status 1

Docker Certified Associate (DCA) Practice Exams Set 23

Docker image is built up from a series of layers and each layer represents an instruction in the image's Dockerfile. True or false?


Options are :

  • False
  • True

Answer : True

If installing Docker using devicemapper for storage with the Intent to run production workloads, how should devicemapper be configured?


Options are :

  • loop-lvm
  • overlay-lvm
  • direct-lvm
  • aufs-lvm

Answer : direct-lvm

What is the recommended way to configure the daemon flags and environment variables for your Docker daemon in a platform independent way?


Options are :

  • Set the configuration options in '/etc/docker/daemon.json'
  • Using 'docker config' to set the configuration options.
  • Set the configuration options using the ENV variable
  • Set the configuration DOCKER_OPTS in '/etc/default/docker'

Answer : Set the configuration options in '/etc/docker/daemon.json'

Docker Certified Associate (DCA) Practice Exams Set 23

What is the docker command to add or update a node label?


Options are :

  • docker node update --set-label
  • docker node add --label
  • docker node modify --set-label
  • docker node update --label-add

Answer : docker node update --label-add

What is the docker command to add or update a mount on a service?


Options are :

  • docker service --add-update-mount
  • docker service --mount-volume
  • docker service set --add-update-mount
  • docker service update --mount-add

Answer : docker service update --mount-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 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 8080 and forward to port 80 in the container.
  • Only a single node 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 Exams Set 3

What is one way of directly transferring a Docker Image from one Docker host in another?


Options are :

  • 'docker commit' to save the image outside of the Docker filesystem. Then transfer the file over to the target host and 'docker start' to start the container again.
  • There is no way of directly transferring Docker images between hosts. A Docker Registry must be used ad an intermediary.
  • 'docker push' the image to the IP address of the target host.
  • 'docker save' the image to save it as TAR file and copy it over to the target host. Then use 'docker load' to un-TAR the image back as a Docker image.

Answer : 'docker save' the image to save it as TAR file and copy it over to the target host. Then use 'docker load' to un-TAR the image back as a Docker image.

What is the endpoint that we can use to check the health of a single UCP manager node?


Options are :

  • https:///_status
  • https:///_ping
  • https:///_heartbeat
  • https:///_health

Answer : https:///_ping

Which of the following is the correct command to tag an image?


Options are :

  • docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
  • docker build tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
  • docker tag image SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
  • docker tag TARGET_IMAGE[:TAG] SOURCE_IMAGE[:TAG]

Answer : docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

Docker Certified Associate (DCA) Practice Exams Set 6

Which statement is true?


Options are :

  • CMD is used to run the software is the image along with any arguments
  • ENTRYPOINT cannot be overriden in the "docker container run" command
  • CMD shell format uses this form ["param", param", "param"]
  • ENTRYPOINT cannot be used in conjuction with CMD

Answer : CMD shell format uses this form ["param", param", "param"]

Which statement is true about DTR garbage collection?


Options are :

  • Garbage collection removes DTR images that are older than a configurable of days
  • Garbage collection removes exited containers from cluster nodes.
  • Garbage collection removes unused volumes from cluster nodes
  • Garbage collection removes unreferenced image layers from DTR's backend storage.

Answer : Garbage collection removes unreferenced image layers from DTR's backend storage.

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


Options are :

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

Answer : 4 managers of which 2 are healthy

Docker Certified Associate (DCA) Practice Exams Set 25

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 service ps http'
  • 'docker service inspect http'
  • 'docker inspect http'
  • 'docker ps http'

Answer : 'docker service inspect http'

Which of the following statements is incorrect?


Options are :

  • The column 'virtual size' of docker ps -s output shows the amount of data used for the read-only image data used by the container plus the container's writable layer 'size'.
  • When a container is deleted, the writable layer is persisted.
  • Copy-on-write is a Docker strategy of sharing and copying files for maximum efficiency.
  • The column 'size' of docker ps -s output shows the amount of data that is used for the writable layer of each container.

Answer : When a container is deleted, the writable layer is persisted.

What is the docker command for displaying layers of a Docker image?


Options are :

  • docker info
  • docker image layers
  • docker history
  • docker layers

Answer : docker history

Docker Certified Associate (DCA) Practice Exams Set 6

A user is having problems running Docker. Which of the following will start Docker in debug mode?


Options are :

  • Start the 'dockerd' process manually with the '--raw-logs' flag set to debug
  • Set the logging key to debug in the 'daemon.json' file.
  • Start the 'dockerd' process manually with the '--logging' flag set to debug
  • Set the debug key to true in the 'daemon.json' file.

Answer : Set the debug key to true in the 'daemon.json' file.

A service 'wordpress' is running using a password string to connect to a non-Dockerized database service. The password string is passed into the 'wordpress' service as a Docker secret. Per security policy, the password on the database was changed. Identity the correct sequence of steps to rotate the secret from the old password to the new password.


Options are :

  • Create a new docker secret with a new password. Trigger a rolling update of the "wordpress" service, by using "-- secret-rm" & "--secret-add" to remove the old secret and add the updated secret.
  • Trigger an update to the service by using 'docker service update --secret='
  • Create a new docker secret with the new password. Remove the existing service using 'docker service rm'. Start a new service with the new secret using "--secret="
  • Create a new docker secret with the new password. Trigger a rolling secret update by using the 'docker secret update' command

Answer : Create a new docker secret with a new password. Trigger a rolling update of the "wordpress" service, by using "-- secret-rm" & "--secret-add" to remove the old secret and add the updated secret.

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


Options are :

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

Answer : docker service update --publish-add

Docker Certified Associate (DCA) Practice Exams Set 6

Which set of commands can identify the publishd port(s) for a container? (Choose 1.)


Options are :

  • 'docker container inspect', docker port'
  • 'docker network inspect','docker port'
  • 'docker port inspect', 'docker container inspect'
  • 'docker info','docker network inspect'

Answer : 'docker container inspect', docker port'

What is the image storage solution that is part of Docker Enterprise Edition called?


Options are :

  • Docker Hub
  • Universal Control Plane
  • Docker Registry
  • Docker Trusted Registry

Answer : Docker Trusted Registry

What is the docker command to find the current logging driver for a running container?


Options are :

  • docker indo
  • docker config
  • docker status
  • docker inspect

Answer : docker inspect

Docker Certified Associate (DCA) Practice Exams Set 9

How do you configure Docker engine to use a registry that is not configured with TLS certificates from a trusted CA?


Options are :

  • Set IGNORE_TLS in the 'daemon.json' configuration file.
  • Set and export the IGNORE_TLS environment variable on the command line
  • Pass the '--insecure-registry' flag to the daemon at run time
  • Set INSECURE_REGISTRY in the '/etc/docker/default' configuration file

Answer : Pass the '--insecure-registry' flag to the daemon at run time

Publishing a service's port using the routing mesh makes the service accessible at the published port on every swarm node. True or false?


Options are :

  • False
  • True

Answer : True

What is the docker command to roll back to the previous version of a service?


Options are :

  • docker service --rollback
  • docker service update --rollback-version
  • docker service update --rollback
  • docker service --rollback-version

Answer : docker service update --rollback

Docker Certified Associate (DCA) Practice Exams Set 9

What is the command to set DNS server for all Docker containers?


Options are :

  • dockerd --dns-server IP_ADDRESS
  • dockerd --dns-update IP_ADDRESS
  • dockerd --dns IP_ADDRESS
  • dockerd --set-dns IP_ADDRESS

Answer : dockerd --dns IP_ADDRESS

Which one of the following commands will result in the volume being removed automatically once the container has exited?


Options are :

  • 'docker run --rm -v /foo busybox'
  • 'docker run --remove -v /foo busybox'
  • 'docker run --read-only -v /foo busybox'
  • 'docker run --del -v /foo busybox'

Answer : 'docker run --rm -v /foo busybox'

Dockerfile option EXPOSE publish the port to external systems. True or false?


Options are :

  • True
  • False

Answer : False

Docker Certified Associate (DCA) Practice Exams Set 5

What is the docker command to create a container with custom DNS server(s)?


Options are :

  • docker container create --set-dns=IP_ADDRESS
  • docker container create --custom-dns=IP_ADDRESS
  • docker container create --dns=IP_ADDRESS
  • docker container create --add-dns=IP_ADDRESS

Answer : docker container create --dns=IP_ADDRESS

What type of network is ingress network?


Options are :

  • bridge network
  • overlay network
  • host network
  • macvlan network

Answer : overlay network

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


Options are :

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

Answer : docker service update --network-add

Docker Certified Associate (DCA) Practice Exams Set 9

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


Options are :

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

Answer : DOCKER_CONTENT_TRUST=1

Which of the following is NOT backed up when performing a Docker Trusted backup operation?


Options are :

  • Repository metadata
  • Image blobs
  • Access control to repos and images
  • DTR configurations

Answer : Image blobs

What is the difference between the ADD and COPY dockerfile instructions? (choosen 2)


Options are :

  • ADD supports compression format handling while COPY does not.
  • COPY supports compression format handling while ADD does not.
  • COPY supports regular expression handling while ADD does not.
  • ADD support remote URL handling while COPY does not.
  • ADD supports regular expression handling while COPY does not.

Answer : ADD supports compression format handling while COPY does not. ADD support remote URL handling while COPY does not.

Docker Certified Associate (DCA) Practice Exams Set 25

What do we call the runtime instance of a Docker image?


Options are :

  • package
  • swarm
  • layer
  • container

Answer : container

Docker Certified Associate (DCA) Practice Exams Set 4

Which Docker build instruction should be used to run the software contained by your image, along with any arguments?


Options are :

  • CMD
  • ENTRYPOINT
  • RUN
  • FROM

Answer : CMD

You have just deployed a Docker Swarm onto two machines: a manager and a worker. You would now like to access your app. Which of the machines' IP addresses can you use?


Options are :

  • only the manager
  • only the worker
  • neither; Docker Swarms use an external load balancer
  • either

Answer : either

When writing a Dockerfile, what does the FROM command signify?


Options are :

  • The programming language used
  • The current container's author
  • The host operating system
  • The image upon which this container is based

Answer : The image upon which this container is based

Docker Certified Associate (DCA) Practice Exams Set 3

Which of the following does Docker NOT provide as a native logging integration?


Options are :

  • Nagios
  • Splunk
  • Fluentd
  • AWS CloudWatch

Answer : Nagios

What is Dockerís reserved, minimal image called?


Options are :

  • blank
  • base
  • start
  • scratch

Answer : scratch

When creating a Docker swarm service with docker service create , which of the following options for the runtime environment can you not configure?


Options are :

  • the service's exposed ports
  • the username or UID for the container
  • environment variables inside the container
  • the working directory inside the container

Answer : the service's exposed ports

Docker Certified Associate (DCA) Practice Exams Set 7

Which Docker build command should be used to expose any database storage area, configuration storage, or files/folders created by your docker container?


Options are :

  • DATA
  • PERSIST
  • VOLUME
  • WORKDIR

Answer : VOLUME

What command would you run if you want to run a scratch Docker container with host port 4000 mapped to the container's exposed port 80?


Options are :

  • docker run -p 4000:80 scratch
  • docker run --expose 4000:80 scratch
  • docker run --expose 80:4000 scratch
  • docker run -p 80:4000 scratch

Answer : docker run -p 4000:80 scratch

You want the Docker daemon to output debug logs. In which file can you enable a flag to cause this to happen?


Options are :

  • settings.json
  • docker.json
  • debug.json
  • daemon.json

Answer : daemon.json

Docker Certified Associate (DCA) Practice Exams Set 26

Which of the following is NOT a network created by Docker when it is installed?


Options are :

  • none
  • host
  • bridge
  • base

Answer : base

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions
  • 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 service ps http'
    'docker service inspect http'
    'docker inspect http'  <- Wrong 
    'docker ps http'    <- CORRECT 
    Answer : 'docker service inspect http'   <- Wrong 
    
    Explanation:
    https://docs.docker.com/engine/reference/commandline/service_ps/
    "docker service ps" ...  In addition to running tasks, the output also shows the task history. 
    
    Reply
  • User
    Which statement is true?
    
    
    Options are :
    
    CMD is used to run the software is the image along with any arguments --> true
    https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
    https://stackoverflow.com/questions/21553353/what-is-the-difference-between-cmd-and-entrypoint-in-a-dockerfile
    
    ENTRYPOINT cannot be overriden in the "docker container run" command --> false
    >On the other hand, ENTRYPOINT is preferred when you want to define a container with a specific executable. You cannot override an ENTRYPOINT when starting a container unless you add the --entrypoint flag.
    
    https://phoenixnap.com/kb/docker-cmd-vs-entrypoint
    
    CMD shell format uses this form ["param", param", "param"] --> false (https://docs.docker.com/engine/reference/builder/#cmd)
    
    ENTRYPOINT cannot be used in conjuction with CMD --> false
    Reply
    • yeah true
      Reply
      • Wrong.
        
        CMD shell format uses this form ["param", param", "param"]  -> TRUE (becouse that is one of the correct formats).
        
        CMD is used to run the software is the image along with any arguments  ->FALSE
        
        CMD is not used If you start image with any arguments.
        
        Reply