Professional Documents
Culture Documents
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
Docker for Web Developers
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
1. Docker Images consist of read-only layers.
A. False
B. True
Answer: B. True
-----------------------------------------------------------------------------------
-
2. What task does Docker Machine perform?
A. All of these
-----------------------------------------------------------------------------------
-
3. Specific framework versions (Node.js, ASP.NET, etc.) can be loaded on a
developer machine by creating a custom Dockerfile.
A. True
B. False
Answer: A. True
-----------------------------------------------------------------------------------
-
4. What file does Docker Compose use to define services?
A. compose.xml
B. Dockerfile
C. docker-compose.son
D. docker-compose.yml
Answer: D. docker-compose.yml
-----------------------------------------------------------------------------------
-
5. What Dockerfile instruction can be used to execute "npm install" when creating a
custom Image?
A. None of these
B. npm install
-----------------------------------------------------------------------------------
-
6. What command-line switches are used with legacy linking?
-----------------------------------------------------------------------------------
-
7. Bridge networks can be defined in Docker Compose files.
A. True
B. False
Answer: A. True
-----------------------------------------------------------------------------------
-
8. Docker Kitematic provides a way to visually search for images hosted on
________?
A. Docker Hub
B. VirtualBox
C. Docker Client
D. Docker Machine
-----------------------------------------------------------------------------------
-
9. Docker containers can be started and stopped.
A. True
B. False
Answer: A. True
-----------------------------------------------------------------------------------
-
10. Which of the following tasks can Docker Cloud perform?
A. Create nodes
B. None of these
D. All of these
E. Create stacks
-----------------------------------------------------------------------------------
-
11. What is the role of Docker images?
D. All of these
-----------------------------------------------------------------------------------
-
12. Which of the following options can be used in a Docker Compose file?
A. env_file
B. All of these
C. container_name
D. networks
-----------------------------------------------------------------------------------
-
13. Environment variables can be defined in Docker Compose files.
A. False
B. True
Answer: B. True
-----------------------------------------------------------------------------------
-
14. How do you show all containers on a machine?
A. docker rmi -p
B. docker showAllContainers -a
C. docker ps -a
D. docker-machine ps -a
Answer: C. docker ps -a
-----------------------------------------------------------------------------------
-
15. What syntax can be used to create a volume that "hooks" to a source code folder
on your machine?
C. None of these
-----------------------------------------------------------------------------------
-
16. What Docker command can be used to view information about a custom network?
A. None of these
-----------------------------------------------------------------------------------
-
17. What syntax can be used to publish an image to Docker Hub?
-----------------------------------------------------------------------------------
-
18. What benefits do container networks offer?
A. Allow containers to communicate with each other in an isolated network
D. All of these
-----------------------------------------------------------------------------------
-
19. What tool can be used to visually work with images and containers?
A. None of these
B. VirtualBox
C. Docker Engine
D. Docker Kitematic
-----------------------------------------------------------------------------------
-
20. What cloud provider does Docker Compose support?
B. All of these
C. Digital Ocean
D. Microsoft Azure
-----------------------------------------------------------------------------------
-
21. What command-line switch can be used to define a custom Dockerfile file name
(such as node.dockerfile) when building a custom image?
A. -t
B. -customfile
C. -f
D. -v
Answer: C. -f
-----------------------------------------------------------------------------------
-
-----------------------------------------------------------------------------------
-
22. Which of the following tasks can Docker Compose perform?
A. Start and stop containers
C. None of these
D. All of these
E. Build services
-----------------------------------------------------------------------------------
-
23. What command can be used to start a container?
B. docker ps -a
-----------------------------------------------------------------------------------
-
24. Docker Cloud YAML files are identical to Docker Compose YAML files.
A. False
B. True
Answer: A. False
-----------------------------------------------------------------------------------
-
25. What Docker Client command can be used to create a container network?
C. docker createNetwork
D. docker ps network
-----------------------------------------------------------------------------------
-
26. Key benefits of Docker for web developers includes:
B. All of these
-----------------------------------------------------------------------------------
-
27. A Docker _______ has a "thin R/W layer."
A. Image
B. File
C. None of these
D. Container
Answer: D. Container
-----------------------------------------------------------------------------------
-
28. What Docker technologies are available to support communication between
containers?
B. None of these
-----------------------------------------------------------------------------------
-
29. What Docker Compose command can be used to start multiple service containers?
A. None of these
B. docker-compose start
C. docker-compose up
D. docker run
Answer: C. docker-compose up
-----------------------------------------------------------------------------------
-
30. Docker Kitematic can ONLY be used to download Docker images.
A. True
B. False
Answer: B. False
-----------------------------------------------------------------------------------
-
31. Services can be organized into ______ with Docker Cloud.
A. roles
B. stacks
C. zones
D. groups
Answer: B. stacks
-----------------------------------------------------------------------------------
-
32. Docker works the same way as virtual machines.
A. False
B. True
Answer: A. False
-----------------------------------------------------------------------------------
-
33. What Docker Compose command can be used to create service images?
A. docker-compose create
B. docker compose
C. docker-compose build
D. docker-compose make
-----------------------------------------------------------------------------------
-
34. Docker Toolbox can only be installed and run on Linux.
A. False
B. True
Answer: A. False
-----------------------------------------------------------------------------------
-
35. Each instruction in a Dockerfile creates an intermediate container as the image
is built.
A. True
B. False
Answer: A. True
-----------------------------------------------------------------------------------
-
36. What key concepts does Docker rely on?
-----------------------------------------------------------------------------------
-
37. Setting up communications between multiple containers always requires multiple
Docker run statements to be executed.
A. False
B. True
Answer: A. False
-----------------------------------------------------------------------------------
-
38. Docker volumes are persisted even after a container is deleted.
A. True
B. False
Answer: A. True
-----------------------------------------------------------------------------------
-
39. Docker Cloud provides a browser-based terminal for services.
A. False
B. True
Answer: B. True
-----------------------------------------------------------------------------------
-
40. You've run the "docker ps" command but no containers are showing. Why?
C. None of these
A. Create a custom docker image with the source code or create a data volume
pointing to your dev machine
C. Create a custom container with the source code and use the "mount" command
to point to your dev machine
D. None of these
Answer: A. Create a custom docker image with the source code or create a data
volume pointing to your dev machine
-----------------------------------------------------------------------------------
-
42. What command can be used to "link" a command terminal window to a Docker
machine?
-----------------------------------------------------------------------------------
-
43. What syntax can be used to delete a Docker volume and a container?
D. docker rm -v containerName
-----------------------------------------------------------------------------------
-
44. VirtualBox is required to use Docker on Mac and Windows dev machines.
A. True
B. False
Answer: A. True
-----------------------------------------------------------------------------------
-
45. Which of the following use Docker's layered file system?
C. All of these
D. VirtualBox
-----------------------------------------------------------------------------------
-
46. What syntax can be used to create a volume that Docker manages?
C. None of these
-----------------------------------------------------------------------------------
-
47. What syntax can be used to convert a Dockerfile into an Image?
-----------------------------------------------------------------------------------
-
48. Which of the following tools are included in Docker Toolbox?
A. Docker Client
B. VirtualBox
C. All of these
D. Docker Kitematic
E. Docker Machine
-----------------------------------------------------------------------------------
-
49. What command can be run to download an image from Docker Hub?
A. docker ps -a
D. docker images
-----------------------------------------------------------------------------------
-
50. What Docker Client command can be used to convert a Dockerfile into an Image?
A. docker createimage
B. docker buildimage
C. docker build
D. docker create
-----------------------------------------------------------------------------------
-
51. Which of the following statements accurately describe a Docker volume?
B. All of these
-----------------------------------------------------------------------------------
---------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
---------------------------------------------------------------------------------
Docker Deep Dive
-----------------------------------------------------------------------------------
---------------------------------------------------------------------------------
1. Which option can we pass to the Docker daemon to make it assign the Docker
bridge a specific IP range?
A. --bip
B. --network
C. --ip-range
D. --cidr
Answer: A. --bip
-----------------------------------------------------------------------------------
-
2. Which Dockerfile Instruction is the preferred instruction for setting the main
process to run inside a container?
A. DEFAULT
B. ENTRYPOINT
C. CMD
D. RUN
Answer: B. ENTRYPOINT
-----------------------------------------------------------------------------------
-
3. Which command shows us detailed container info including the containers PID
within the Docker Hosts process tree?
-----------------------------------------------------------------------------------
-
4. When using the ENTRYPOINT Instruction in a Dockerfile, how are CMD Instructions
treated?
-----------------------------------------------------------------------------------
-
5. Which Dockerfile Instruction do we use to install packages to our new Image?
A. FROM
B. RUN
C. apt-get install
D. CMD
Answer: B. RUN
-----------------------------------------------------------------------------------
-
6. What is the name of the primary virtual Ethernet NIC inside of each Docker
container?
A. veth0
B. eth1
C. veth1
D. eth0
Answer: D. eth0
-----------------------------------------------------------------------------------
-
7. Which Docker command lets us attach to a running container?
-----------------------------------------------------------------------------------
-
8. Which of the following docker run commands will start a Container based on an
Ubuntu 14.04 Base Image?
-----------------------------------------------------------------------------------
-
9. Which of the following commands will install the Docker engine on an Ubuntu
server?
A. cf install docker.io
-----------------------------------------------------------------------------------
-
10. Virtual Machines are a form of what type of virtualization?
A. Container
B. Hypervisor
C. VLAN
D. Mainframe
Answer: B. Hypervisor
-----------------------------------------------------------------------------------
-
11. How do recipient containers learn about the networking config of source
containers they are linked to?
-----------------------------------------------------------------------------------
-
12. Which of the following commands will show version information for the various
installed Docker components?
A. docker version
B. apt-get update
C. docker detail
D. rkt version
-----------------------------------------------------------------------------------
-
13. Which Docker command builds a new image from a Dockerfile in the current
directory?
A. docker build
B. docker build-image .
C. docker image .
D. docker build .
-----------------------------------------------------------------------------------
-
14. What does pressing Control+P+Q inside of a container do?
-----------------------------------------------------------------------------------
-
15. Which Docker command shows running Docker Containers?
A. docker ps
D. rkt ps
Answer: A. docker ps
-----------------------------------------------------------------------------------
-
16. Which of the following is a major advantage of Containers over Virtual
Machines?
-----------------------------------------------------------------------------------
-
17. Which of the following is an advantage of Linking Containers when compared to
exposing ports?
-----------------------------------------------------------------------------------
-
18. What is the correct syntax to mount the /project/data directory from the Docker
host into a directory called /data in a container?
-----------------------------------------------------------------------------------
-
19. By default, what happens to a Docker Container when the process it is running
exits?
-----------------------------------------------------------------------------------
-
20. Which of the following commands will install the Docker engine on a CentOS
server?
-----------------------------------------------------------------------------------
-
21. In a default installation, how does the Docker daemon natively access features
like kernel namespaces and cgroups?
A. via capabilities
B. via devicemapper
C. via LXC
D. via libcontainer
-----------------------------------------------------------------------------------
-
22. How are comments added to a Dockerfile?
-----------------------------------------------------------------------------------
-
23. Which Dockerfile Instruction must be the first Instruction in a Dockerfile?
A. MAINTAINER
B. RUN
C. A comment
D. FROM
Answer: D. FROM
-----------------------------------------------------------------------------------
-
24. Which transient image layer exists below the rootfs while a container starts?
B. Layer 1
D. Bootfs
Answer: D. Bootfs
-----------------------------------------------------------------------------------
-
25. Which Dockerfile instruction defines the base image to build from?
A. BASEIMAGE
B. FROM
C. BaseImage
D. BASE
Answer: B. FROM
-----------------------------------------------------------------------------------
-
26. At the time of recording the course, what is the default storage driver used by
CentOS for Docker containers?
A. OverlayFS
B. NTFS.SYS
C. AUFS
D. devicemapper
Answer: D. devicemapper
-----------------------------------------------------------------------------------
-
27. Which of the following is the correct way to name a Dockerfile?
A. DockerFile
B. DOCKERFILE
C. Dockerfile
D. dockerfile
Answer: C. Dockerfile
-----------------------------------------------------------------------------------
-
28. Which of the following is true about RUN Instructions in a Dockerfile?
D. RUN Instructions only work with containers that have elevated privileges
-----------------------------------------------------------------------------------
-
29. From a Docker Host, which command can we use to stop a container?
D. docker-stop <container>
Answer: C. docker stop <container>
-----------------------------------------------------------------------------------
-
30. Which of the following is another term to describe container virtualization?
A. Storage virtualization
B. Hypervisor virtualization
C. OS level virtualization
-----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Getting Started with Docker on Windows
-----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
1. What is a dangling volume?
D. The default volume for the container file system that's unpacked from the
image
-----------------------------------------------------------------------------------
-
2. What image type is blessed by both Docker and the people behind the software it
contains?
A. Blessed
B. Official
C. Trusted
D. Automated Build
Answer: B. Official
-----------------------------------------------------------------------------------
-
3. What does docker history do?
-----------------------------------------------------------------------------------
-
4. Why does Docker for Windows need Hyper-V?
Answer: D. To run linux containers inside a linux VM and Hyper-V windows containers
-----------------------------------------------------------------------------------
-
5. In the past we had to install software before we could run it. What is the
equivalent step with Docker to be able to run software?
A. Run a container
B. Installs a container
C. Create a container
D. Pulls a container
-----------------------------------------------------------------------------------
-
6. What docker command executes software?
A. `docker pull`
B. `docker run`
C. `docker ps`
D. `docker stop`
-----------------------------------------------------------------------------------
-
7. When executing the command "docker pull microsoft/aspnet:4.6.2" what does
"microsoft/aspnet:4.6.2" refer to?
A. Repository
B. User
C. Registry
D. Tag
E. Image
Answer: E. Image
-----------------------------------------------------------------------------------
-
8. When using docker-compose, by default, what network are linux containers
connected to?
A. host
B. none
C. bridge
-----------------------------------------------------------------------------------
-
9. What is a tag?
A. A reference to a registry
B. A reference to a repository
-----------------------------------------------------------------------------------
-
10. Why are image layers read only?
-----------------------------------------------------------------------------------
-
11. Which of the following container types doesn't use namespace isolation?
B. Hyper-V Container
C. Linux Container
Answer: B. Hyper-V Container
-----------------------------------------------------------------------------------
-
12. Which of the following provides the initial container file system?
A. Volume(s)
B. Network drive
D. Image
Answer: D. Image
-----------------------------------------------------------------------------------
-
A. Image layer
B. Volume
Answer: B. Volume
-----------------------------------------------------------------------------------
-
14. In the past, to find software, we often used standalone web sites hosted by the
creator of the software. Now, with Docker, how do we discover software?
A. Package Managers
C. Docker Engine
D. App Stores
E. Docker Hub
-----------------------------------------------------------------------------------
-
15. In the past, we usually downloaded software in some sort of package to install
it, for example a zip file or MSI file. Now, with Docker, how do we download
software?
A. `docker pull`
B. `docker start`
C. `docker ps`
D. `docker download`
-----------------------------------------------------------------------------------
-
16. When executing the command "docker pull microsoft/aspnet:4.6.2" what is the
"microsoft" piece called?
A. User
B. Image
C. Tag
D. Registry
E. Repository
Answer: A. User
-----------------------------------------------------------------------------------
-
17. On a computer, with either Linux or Windows installed, there's a program that
runs in a privileged mode that abstracts hardware and provides services to other
processes. What is this program?
A. User
B. User space
C. Kernel
D. Kernel space
E. Application
Answer: C. Kernel
-----------------------------------------------------------------------------------
-
18. After stopping a container, how do you run the application in it again?
-----------------------------------------------------------------------------------
-
19. What's the primary purpose of docker-compose?
D. Cleanup containers.
E. Build containers
-----------------------------------------------------------------------------------
-
20. What does the -d in docker run -d nginx do?
B. Runs a container that will display output from the NGINX process in our
console
-----------------------------------------------------------------------------------
-
21. Where does the file system come from for a container?
-----------------------------------------------------------------------------------
-
22. Which of the following allows you to share the host file system with a process
in a container?
A. Network drive(s)
B. Image(s)
C. symlinks
D. Volume(s)
Answer: D. Volume(s)
-----------------------------------------------------------------------------------
-
23. How can you see th