Docker Certified Associate (DCA) Practice Tests Set 2

What would be the output of the final pwd command of a container built from the following Dockerfile?


Options are :

  • /
  • /c
  • /b/c (Correct)
  • /a

Answer :/b/c

Docker Certified Associate (DCA) Practice Tests Set 6

How can you find untagged images?


Options are :

  • docker images --filter "dangling=true" (Correct)
  • docker images --filter "tagged=false"
  • docker images --format "tagged=false"
  • docker images --format "dangling=true"

Answer :docker images --filter "dangling=true"

Which docker entity can be described as "an executable package that includes everything needed to run an application--the code or binary, a runtime, libraries, environment variables, and configuration files"?


Options are :

  • Image (Correct)
  • Docker File
  • Node
  • Container

Answer :Image

What is the purpose of the FROM directive?


Options are :

  • It indicates the build context.
  • It pulls a file from an external source into the image.
  • It sets a base image that can be used for subsequent instructions. (Correct)
  • It sets the working directory of containers ran using the image.

Answer :It sets a base image that can be used for subsequent instructions.

Docker Certified Associate (DCA) Practice Exams Set 16

ARG variables are persisted into the built image the same as the ENV variables.


Options are :

  • FALSE (Correct)
  • TRUE

Answer :FALSE

A docker file must always be named Dockerfile?


Options are :

  • TRUE
  • FALSE (Correct)

Answer :FALSE

Which of the following Dockerfile directive is used to add metadata to a docker image?


Options are :

  • ADD
  • ARG
  • LABEL (Correct)
  • METADATA

Answer :LABEL

Docker Certified Associate (DCA) Practice Exams Set 9

Which of the following directive will execute a command at build time?


Options are :

  • CMD
  • RUN (Correct)

Answer :RUN

What is the Dockerfile LABEL option used for?


Options are :

  • Tells Docker how to test a container to check that it is still working.
  • Label a container that will run as an executable
  • Adds metadata to an image (Correct)
  • Provide defaults for an executing container

Answer :Adds metadata to an image

It is good practice to have more than one RUN instruction in the Docker file?


Options are :

  • FALSE
  • TRUE (Correct)

Answer :TRUE

Docker Certified Associate (DCA) Practice Exams Set 19

Which command can you use to display the layers of a docker image?


Options are :

  • docker image layers
  • docker layers
  • docker image info
  • docker image history (Correct)

Answer :docker image history

Which of the following instructions can be used to specify variables that are available to the RUN instruction?


Options are :

  • Both ARG and ENV are valid (Correct)
  • ENV
  • ARG

Answer :Both ARG and ENV are valid

Which of the following options is NOT a valid way to tag a Docker image?


Options are :

  • Tag an image referenced by Name
  • Tag an image referenced by user ID (Correct)
  • Tag an image referenced by Name and Tag
  • Tag an image referenced by image ID

Answer :Tag an image referenced by user ID

Docker Certified Associate (DCA) Practice Tests Set 7

Can you save a Docker image in multiple repositories after the build?


Options are :

  • TRUE (Correct)
  • FALSE

Answer :TRUE

Which command returns detailed information on a Docker Image?


Options are :

  • docker image info
  • docker image stats
  • docker image inspect (Correct)
  • docker image history

Answer :docker image inspect

DTR only allows deleting images that are signed. True or false?


Options are :

  • FALSE (Correct)
  • TRUE

Answer :FALSE

Docker and Containers: Commands Set 1

Which directive informs Docker that a container listens on specified network ports at runtime?


Options are :

  • ENV
  • TAG
  • LABEL
  • EXPOSE (Correct)

Answer :EXPOSE

In Docker Trusted Registry, how would a user prevent an image from being overwritten by another user which has push access to the repository?


Options are :

  • Use the DTR web UI to make the tag immutable. (Correct)
  • Tag the image with 'nginx:immutable'
  • Remove push access from all other users.
  • Keep a backup copy of the image on another repository.

Answer :Use the DTR web UI to make the tag immutable.

Which of the following commands can be used to find the architecture and operating system an image is compatible with?


Options are :

  • docker image ls
  • docker image info
  • docker image inspect --filter '{?{.Architecture}} {?{.Os}}'
  • docker image inspect --format '{?{.Architecture}} {?{.Os}}' (Correct)

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

Docker Certified Associate (DCA) Practice Exams Set 22

Who is responsible to run the docker build command?


Options are :

  • docker engine
  • docker-machine
  • docker daemon (Correct)
  • docker cli

Answer :docker daemon

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


Options are :

  • FALSE (Correct)
  • TRUE

Answer :FALSE

The following Dockerfile results in an image after the build. What happens when executing docker run using this image?


Options are :

  • Nothing happens. The volume was created while building the image.
  • It creates a new empty mount point at /myvol.
  • It creates a new mount point at /myvol and copy the greeting file into the newly created volume. (Correct)

Answer :It creates a new mount point at /myvol and copy the greeting file into the newly created volume.

Docker Certified Associate (DCA) Practice Exams Set 9

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


Options are :

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

Answer :DOCKER_CONTENT_TRUST=1

Which of the following docker command can remove an image, even if that image is used by a running container?


Options are :

  • docker rmi [image name] --force (Correct)
  • docker rm [image name] --force
  • None of the answers is correct.
  • docker remove [image name]

Answer :docker rmi [image name] --force

Which command can be used to upload an image to a registry?


Options are :

  • docker upload [OPTIONS] NAME[:TAG]
  • docker push [OPTIONS] NAME[:TAG] (Correct)
  • docker store [OPTIONS] NAME[:TAG]
  • docker commit [OPTIONS] NAME[:TAG]

Answer :docker push [OPTIONS] NAME[:TAG]

Docker Certified Associate (DCA) Practice Exams Set 25

What is the purpose of a HEALTCHECK instruction within a Dockerfile?


Options are :

  • Instructs Docker how to test a container to check that it is still working. (Correct)
  • Defines the health check endpoint for external monitoring tools to monitor the health of the docker engine.
  • To check if the server process is running.
  • Defines a heartbeat interval.

Answer :Instructs Docker how to test a container to check that it is still working.

What would be the output of the final pwd command of a container built from the following Dockerfile?


Options are :

  • /a
  • /a/b/c (Correct)
  • b
  • c

Answer :/a/b/c

Which of the following is true about docker image rm command?


Options are :

  • Remove dangling images.
  • Remove unused images.
  • Remove one or more images. (Correct)
  • Show the history of an image.

Answer :Remove one or more images.

Docker Certified Associate (DCA) Practice Exams Set 19

What represents a build context that should be considered when building an image?


Options are :

  • All the files found in a specific path or URL (Correct)
  • Dockerfile found in a specific path or URL
  • All dependencies already installed on docker-machine
  • The configuration of the daemon

Answer :All the files found in a specific path or URL

What is the final outcome of a container created from the following Dockerfile?


Options are :

  • Container will ping the localhost for 5 times and will stop running. (Correct)
  • Container will get stuck in infinite pinging loop.
  • Container will remain in created state.
  • Container will ping localhost for 5 times and will return to its shell.

Answer :Container will ping the localhost for 5 times and will stop running.

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions