Docker - ENG - Coursera Flashcards
(33 cards)
What does the Docker CLI run command do?
It runs an image as a container.
In this sample Dockerfile, what does the COPY instruction do?
FROM ubuntu:18.04
COPY . /app
RUN make /app
CMD python /app/app.py
It copies the contents of the current directory into the /app directory of the image as a new layer.
Which command names an image “my-app” and tags it “v1”?
Docker tag -n my-app -t v1 .
docker copy -v my-app:v1 .
docker build -n my-app v1 .
docker build -t my-app:v1 .
docker build -t my-app:v1 .
You can use the Docker COPY instruction to copy files both from your local machine and from remote URLs.
False
Which of the following are benefits of containers?
Each container runs its own operating system (OS).
Like virtual machines (VMs), containers virtualize your infrastructure.
Containers provide a standardized way to package and ship software.
Each container is fully isolated and therefore secure.
Containers provide a standardized way to package and ship software.
What is an image?
An isolated process running on a local or remote host with its own file system and networking.
A read-only file that contains the source code, libraries, and dependencies that are needed to run an application.
A text file that contains the commands and settings that will run a container and the apps running in that container.
A YAML file with key/value pairs specifying the attributes of a container.
A read-only file that contains the source code, libraries, and dependencies that are needed to run an application.
In this sample Dockerfile, what does the FROM instruction do?
FROM ubuntu:18.04
COPY . /app
RUN make /app
CMD python /app/app.py
It defines the base image, which in this case is Ubuntu version 18.04.
What does the docker build command do?
It uses an image to create a container.
It creates a Docker app.
It uses a Dockerfile to create an image.
It creates a Dockerfile.
It uses a Dockerfile to create an image.
You can use the Docker COPY instruction to copy files from your local machine to an image.
True
What does the Docker CLI build command do?
It builds an image from a Dockerfile. It builds a microservice that will run in an image. It builds a Dockerfile. It builds a new container. It builds a new cluster.
It builds an image from a Dockerfile.
Containers include a guest operating system in every instance.
False
In this sample docker build command, what does the -t option do? docker build -t my-app:v1 .
It gives the image the name “my-app” and the tag “v1”.
It tags the current working directory as the target location for the image being built.
It indicates that the version “v1” of “my-app” should be used when building the image.
It indicates that the files used to build the image are located in the current working directory.
It gives the image the name “my-app” and the tag “v1”.
You use the docker push command to distribute an image to a registry.
True
Which of the following is not handled by Kubernetes?
Scaling
Performing health checks
Provisioning and deployment
Automating app integration
Automating app integration
Which of the following two are container runtimes? Select all that apply.
CRI-O Correct rocket DRunner Kubernetes Docker
CRI-O
Docker
A namespace is a Kubernetes object that can be used to segregate a cluster by team or project.
True
False
True
A Deployment is a Kubernetes object that provides updates to which of the following?
ConfigMaps and Secrets
ReplicaSets and ConfigMaps
Secrets and Pods
Pods and ReplicaSets
Pods and ReplicaSets
Which kubectl command creates an object using the details in the pod.json file?
kubectl create -d . pod.json
kubectl create -f pod.json
kubectl create -f ./pod.json
kubectl create -o pod.json
kubectl create -f pod.json
Before you create a Deployment, you must create the associated ReplicaSet.
True
False
False
You can use a SecretMap to store and manage sensitive information, such as passwords.
True
False
False
Which two of the following can be used to provide ConfigMaps to Pods and Deployments? Select all that apply.
Bash scripts Service bindings YAML configuration files String literals Container runtimes
YAML configuration files
String literals
What does the Kubernetes Horizontal Pod Autoscaler do?
Autoscales the cluster’s worker nodes as needed so that additional Pods can be deployed to the infrastructure
Automatically rolls out new Deployments within the system as needed.
Automatically increases or decreases the number of Pods deployed within the system as needed.
Automatically scales up or down the amount of memory allocated to a Deployment as needed.
Automatically increases or decreases the number of Pods deployed within the system as needed
Which command retrieves the Secrets in the “default” namespace?
kubectl get secrets –namespace=default
kubectl get namespace=default –secrets
kubectl get secrets namespace default
kubectl get secrets -s namespace=default
kubectl get secrets –namespace=default
Which of the following statements describes what a ReplicaSet does? Select the four that apply.
Autoscales an application
Provides configuration details to Deployments
Rolls out app changes in an automated and controlled manner
Maintains a stable set of Pods in a cluster, spinning up or deleting pods as needed
Replicates a Deployment
All, except - Autoscales an application