Docker Foundations Professional Certificate

Ace your homework & exams now with Quizwiz!

Which of these problems does Docker Compose not solve? A: Autoscaling containers and transparently moving them from machine to machine. B: Simplifies local development by allowing you to run multiple containers at once. C: Uses a manifest file to declare your application's dependencies and run them in a local Docker network. D: Prevents you from having to run multiple docker CLI commands to start multiple containers.

A: Autoscaling containers and transparently moving them from machine to machine.

Why would you want to mount a directory to your container? A: Because containers do not save data after they are deleted. B: So that your container can access the Internet using the host's network sockets. C: To improve disk IO performance. D: So that the container can create directories.

A: Because containers do not save data after they are deleted.

Which of these statements is true about the docker client? A: On the Mac, the Docker command-line client creates and runs containers in a small Linux-based virtual machine. B: On Windows 10 Anniversary Edition or later, the Docker command-line client creates and runs containers in a small, Linux-based virtual machine. C: On Mac and Windows, the Docker command-line client creates and runs containers natively without a virtual machine.

A: On the Mac, the Docker command-line client creates and runs containers in a small Linux-based virtual machine.

Which of these three commands is docker run a combination of? A: - docker container create - docker container start - docker container inspect B: - docker container create - docker container start - docker ps C: - docker container create - docker container start - docker container attach D: - docker container create - docker ps - docker container attach

C: - docker container create - docker container start - docker container attach

What is a valid format for a Docker Compose file? A: .txt B: .json C: .yaml D: .html

C: .yaml

What is not valid syntax for specifying a Docker volume configuration in Docker Compose? A: /persistence:/myvolume:ro B: /persistence:/myvolume C: /persistence:/myvolume:ro:. D: /myvolume

C: /persistence:/myvolume:ro:.

Select the least true statement from the list. A: Docker Hub is the default container registry used by the Docker client. B: By default, Docker images will receive a latest version tag if a version tag is not provided. C: Anyone can push to Docker Hub. You do not need to register an account. D: Anyone can pull from the Docker Hub without an account

C: Anyone can push to Docker Hub. You do not need to register an account.

What is the difference between the docker start and docker run commands? A: Docker run creates a new runtime configuration. Docker start begins the deployment process. B: Docker run creates a application environment. Docker start executes the commands necessary for the application to run. C: Docker run creates a new container and runs it. Docker start is used to start an existing container. D: Docker run creates a new container and runs it. Docker start is used to start an existing container. You cannot use the docker start command until you have used the docker run command to create the container.

C: Docker run creates a new container and runs it. Docker start is used to start an existing container.

Why is enforcing the availability of dependencies on start-up not recommended? A: It will slow application start-up time. B: An outage in one system will cause an outage in another. C: In a distributed system, it is important to gracefully handle unavailability.

C: In a distributed system, it is important to gracefully handle unavailability.

Which of these benefits for using Kubernetes is most accurate? A: It makes managing thousands of containers much simpler than using Docker alone. B: It is faster than using Docker alone. C: It makes managing hundreds of thousands of containers much simpler than using Docker alone. D: It is less complex than pure Docker.

C: It makes managing hundreds of thousands of containers much simpler than using Docker alone.

Which statement about port mapping is true? A: The port on the host machine must be mapped to the same port number inside the container. B: You should configure exactly one port mapping per service. C: Two containers exposing the same port on the host machine will create port collision errors.

C: Two containers exposing the same port on the host machine will create port collision errors.

How do you monitor and troubleshoot applications running in Docker containers? A: Use Docker Hub. B: Inspect images. C: View the container logs.

C: View the container logs.

You have upgraded your application to a new version, 1.0.1, and created an image for it called my-app. You successfully pushed the image with docker push. Upon logging into Docker Hub, you notice that 1.0.1 is not there but 1.0.0 is. What is the most likely cause for this happening? A: You were temporarily offline while pushing 1.0.1 to Docker Hub. B: Docker Hub only allows you to store one tag per image at a time. C: You ran docker push $DOCKER_HUB_USERNAME/my-app:1.0.0 and forgot to run docker push $DOCKER_HUB_USERNAME/my-app:1.0.1.

C: You ran docker push $DOCKER_HUB_USERNAME/my-app:1.0.0 and forgot to run docker push $DOCKER_HUB_USERNAME/my-app:1.0.1.

What are some common problems with using Docker Machine to run Docker? A: slow disk performance when using volume mounts B: Users need to know how to use and manage Virtualbox for common tasks. C: all of these answers D: slow network performance while using exposed ports

C: all of these answers

In this docker command, what does the period mean? docker build. A: mage tag B: container C: build context

C: build context

How do you view your local images? A: docker image pull B: docker run C: docker image ls

C: docker image ls

What is the command used to remove images? A: docker image ls --no-cache B: docker remove images C: docker rmi

C: docker rmi

Which type of environment is not well suited to use Docker Compose? A: local B: staging C: production D: test

C: production

An environment variable is set in three different places. Which one takes precedence? A: the default value configured inline B: the value set in a .env file C: the value set in the shell

C: the value set in the shell

Which statement about build arguments and environment variables is true? A: Build arguments and environment variables are two different names for the same thing. B: Build arguments are accessible at build time and inside the running container, and environment variables are accessible in the running container only. C: Build arguments are accessible at build time only, and environment variables are accessible at build time and inside the running container. D: Build arguments are accessible during build time only, and environment variables are accessible to the running container only

D: Build arguments are accessible during build time only, and environment variables are accessible to the running container only

Which definition best describes declarative configuration tools like Docker Compose? A: They allow you to specify either the desired end result or an exact sequence of steps to follow. B: They are an alternative to coding languages like Java and Python. C: They allow you to specify an exact sequence of steps to follow. D: They allow you to specify the desired end result only.

D: They allow you to specify the desired end result only.

What is the most correct explanation describing this command: docker exec -i -t 2bf bash (Don't forget to use docker exec --help if you need it!) A: This starts an interactive Bash shell within a container with ID 2bf with a pseudo-TTY allocated to it. B: This starts a Bash shell within a container starting with ID 2bf with a pseudo-TTY allocated to it. C: This starts an interactive Bash shell within a container starting with ID 2bf. D: This starts an interactive Bash shell within a container starting with ID 2bf with a pseudo-TTY allocated to it.

D: This starts an interactive Bash shell within a container starting with ID 2bf with a pseudo-TTY allocated to it.

You can think of some Docker Compose commands as combinations of other Docker Compose commands. Which combination of commands is correct? A: build + create + run = up B: down + up = restart C: build + stop = down D: build + create + start = up

D: build + create + start = up

You started a container that ran a single command. That container has now exited. You would like to get the ID of this container for additional reporting. Which of these commands will successfully complete this task? A: docker ps B: docker inspect C: docker logs D: docker ps -a

D: docker ps -a

You are trying to remove 20 stopped containers with docker ps -aq | xargs docker rm. However, upon doing this, you receive the error below: Error response from daemon: You cannot remove a running container 8dee53d9631c88d1bc431cffa562355f97c44e6120401a4a01c15def989e319b. Stop the container before attempting removal or force remove Which of these commands fixes this problem most efficiently? A: docker system restart && docker ps -aq | xargs docker rm B: docker container create --name 8dee53d9631c88d1bc431cffa562355f97c44e6120401a4a01c15def989e319b our-server && docker rm 8dee C: for i in $(docker ps -aq); do docker rm -f $i; done D: docker ps -aq | xargs docker rm -f

D: docker ps -aq | xargs docker rm -f

Which of these statements is most true about the advantages Docker provides? a. Docker Hub makes it really easy to distribute images to anyone, anywhere b. You can fine-tune namespaces with a configuration file. c. You can run apps that work in Windows on Linux and vice versa. d. You can change the process ID of applications that are already running.

a. Docker Hub makes it really easy to distribute images to anyone, anywhere

Which of these statements is least true about the difference between containers and virtual machines? a. Containers can only run one app at a time. b. Containers do not translate hardware instructions. c. Containers are just smaller virtual machines. d. Virtual machines emulate actual hardware. Containers emulate operating systems.

c. Containers are just smaller virtual machines.

What is the main problem that Docker aims to solve? a. Making app packages smaller so that they take less time to download b. Making it easier to host your web application on the Internet c. apps working on one machine but not others d. automatically compiling your code regardless of the language it's written in

c. apps working on one machine but not others

Which of these options do the statements below describe? - I control how much of any resource a process can get. - CPU time, memory quota, and network access are some of the things you can limit through me. - I cannot limit how much disk space or disk IO a process can use. a. Zones b. Jails c. Namespaces d. Control groups

d. Control groups

You are helping a colleague learn Docker. They said that they created a Docker container from the nginx Docker image, but it does not show up after running docker ps. They confirmed that they could successfully pull the nginx image from Docker Hub. What is the most likely cause and solution for this problem? A: They created the container with docker container create but forgot to start it. Run docker container start to fix. B: The entrypoint for the nginx image they pulled is incorrect. Use dfimage to recreate and save its Dockerfile, change the entrypoint, and build a new image locally. C: They need to run docker pull to pull the nginx image first before running docker container create. D: They provided the wrong image to docker container create. Fix the image, then try again.

A: They created the container with docker container create but forgot to start it. Run docker container start to fix.

You have just installed Docker to begin moving an application that your team supports into containers. You tried running a CLI command but were shown text similar to the below: docker [COMMAND]" requires at least 1 argument. See 'docker [COMMAND] --help'. Usage: docker [COMMAND] [OPTIONS] [ARG...] What is the most likely cause for this happening? A: You forgot to provide additional options or arguments to the command. Run --help to find out what you missed. B: You forgot to provide a subcommand. Run --help to see what you missed. C: The CLI is not configured properly. Edit /etc/docker/docker.json to fix. D: The CLI command is missing a plugin. Visit docker.com to learn how to install it.

A: You forgot to provide additional options or arguments to the command. Run --help to find out what you missed.

What is a docker volume? A: a directory on the host machine that is accessible to a container B: a description added to the metadata of an image c: a group of documents used to facilitate image search

A: a directory on the host machine that is accessible to a container

What command should you use to search the Docker Hub registry for images? A: docker search B: docker start C: docker ls

A: docker search

What command is used to remove all unused images, containers, and networks? A: docker system prune B: docker rmi C: docker cmd

A: docker system prune

What is not a recommended use case for multiple compose files? A: having multiple compose files for different parts of an application or system B: having multiple compose files for independent versions of an application C: having multiple compose files for different environments, such as local and staging

A: having multiple compose files for different parts of an application or system

Your co-worker is having issues getting Docker to work on their Mac. They tell you that whenever they try to use docker run, they get an error that looks like this: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? They told you that they installed Docker Desktop recently. What would you first look for while troubleshooting this issue? A: Open the "System Information" application to verify that their system has enough installed memory available. B: Check that the Docker whale is visible on their taskbar or system tray and that the boxes on top of it are NOT moving. C: Run the command env | grep DOCKER_HOST to confirm that the Docker CLI is configured properly. C: There might not be enough inodes to create Docker volumes. Run df -i to inspect available inodes.

B: Check that the Docker whale is visible on their taskbar or system tray and that the boxes on top of it are NOT moving.

How can you ensure that your images are safe and secure, while still allowing others to access and use them? A: Implement container security. B: Create a private repository. C: Add a secure label.

B: Create a private repository.

How does Docker greatly improve the time it takes Developers to get started on new projects? A: Developers can just download an image without having to install everything they need manually. B: Docker allows Developers to share images containing all of the tools needed to run an application so that they do not need to install everything they need manually. C: Developers can share their configuration in a VM containing their local development environment. D: Developers have the proper documentation to install the tools and software needed to run applications locally.

B: Docker allows Developers to share images containing all of the tools needed to run an application so that they do not need to install everything they need manually.

You are debugging a broken Jenkins pipeline that deploys your application into production. It creates Docker containers during the testing stage of the pipeline. You see this error message in the logs for the last build: $: docker run --rm my-app:v7.2.1 Unable to find image 'my-app:7.2.1' locally docker: Error response from daemon: manifest for my-app:7.2.1 not found: manifest unknown: manifest unknown. See 'docker run --help'. What is the most likely cause for this error? A: The Jenkins runner node does not have enough disk space to pull new Docker images. B: Docker was not able to find a container image named my-app:7.2.1 in Docker Hub or your private registry. C: The test stage forgot to run docker container create before executing docker run. D: Docker was not fully installed on this Jenkins node.

B: Docker was not able to find a container image named my-app:7.2.1 in Docker Hub or your private registry.

What command tells Docker what base image to use in a dockerfile? A: WORKDIR B: FROM C: CMD

B: FROM

How do you view key information to help you with troubleshooting errors? A: Run a docker system search. B: Inspect the image. C: View the docker compose file.

B: Inspect the image.

What is the primary advantage of using a named volume? A: It reduces bugs due to naming conflicts. B: It prevents Docker from creating a new volume for each run, which will take up extra memory on the host machine. C: It prevents Docker from deleting all volume data periodically. D: Giving a volume a name clears up confusion.

B: It prevents Docker from creating a new volume for each run, which will take up extra memory on the host machine.

What is the most correct definition of service profiles in Docker Compose? A: Service profiles allow you to group sets of environment variables together within the Docker Compose configuration. B: Service profiles allow you to organize Docker services into one or more categories for easy start-up. C: Service profiles allow you to document Docker services inside a configuration file.

B: Service profiles allow you to organize Docker services into one or more categories for easy start-up.

Which of these reasons best summarizes why you should not use the latest tag when building Docker images? A: It makes your Docker image bigger, as Docker includes additional files and configurations for images tagged with latest. B: The application within the image can change when pulled again in the future. C: It makes Docker containers faster. D: It makes Docker containers slower.

B: The application within the image can change when pulled again in the future.

When would you want to bind a port on your computer to that of a container? A: When you want to save data from your container. B: When your container is running a network service that you want to use from your computer. C: When your container needs access to the Internet. D: When your container is running a network service that you want to use from within the container.

B: When your container is running a network service that you want to use from your computer.

Which of these statements about docker container start is true? A: You must run docker rm before running docker container start. B: You can run docker container start against a container multiple times. C: You can only run docker container start against a container once. To re-run, delete the container first. D: You must run docker run before running docker container start.

B: You can run docker container start against a container multiple times.

You are creating a Dockerfile that will be pushed into your company's private Docker registry. The application is a NodeJS-based to-do list for keeping track of Key Results, or OKRs. Your Dockerfile uses express as its webserver. Your terminal hangs while trying to start a container from this image. You can't seem to exit it, no matter how many keystrokes you provide. The application does not hang when you run it normally on your computer. What is the most likely cause for this happening? A: This is a known bug in the express web server. Switch to nginx as your base image. B: You ran docker run without providing the --interactive option and cannot stop the web server hosting your web app. C: You have an infinite loop in your application somewhere that only happens when it is run within a Docker container. D: You forgot to run docker container start after running docker container create.

B: You ran docker run without providing the --interactive option and cannot stop the web server hosting your web app.

You're not able to create more containers. Which of these commands will not help you reclaim enough space to create containers? A: docker system prune B: df -h / C: docker rmi nginx D: docker rmi -f $(docker images -f "dangling=true" -q)

B: df -h /

What command gives you valuable insights into the container's behavior and helps to identify potential problem areas? A: docker search [IMAGE ID] B: docker inspect [CONTAINER ID] C: docker ls [CONTAINER ID]

B: docker inspect [CONTAINER ID]

What is the command used to list all running containers on your machine? A: docker images --containers B: docker ps C: docker search

B: docker ps

You have upgraded your application to a new version, 1.0.1, and created an image for it called my-app. Which of these commands should you run to make it easy for others to find on the Docker Hub? A: docker tag my-app $DOCKER_HUB_USERNAME/my-app:latest B: docker tag my-app $DOCKER_HUB_USERNAME/my-app:v1.0.1 C: docker tag my-app my-app:latest D: docker tag my-app my-app:v1.0.1

B: docker tag my-app $DOCKER_HUB_USERNAME/my-app:v1.0.1

Which of these commands can you run to debug a slow container? A: docker images B: docker top [container-id] C: docker run D: docker rmi

B: docker top [container-id]

When should you use image labels vs. tags? A: when you want to push an image version to a private repository B: when you want to add vendor information to the image metadata C: when you want to run a container using a specific image

B: when you want to add vendor information to the image metadata


Related study sets

What Events occurred after the victory at Trenton

View Set

Chapter 2: Beginnings of English America, 1607-1660

View Set

Enzymes and hormones of the digestive System

View Set

Assessment and Care of Patients with Ear and Hearing Problems

View Set

Chapter 8 Hardware and Systems Security

View Set