Docker - ENG - Coursera Flashcards
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
Which of the following Kubernetes objects are used to run applications? Select the four that apply.
ReplicaSets ibmcloud CLI ConfigMaps Secrets Service bindings
All, except - ibmcloud CLI
In this sample kubectl command, what does get deployments tell us? Select the four that apply.
» kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
Nginx-deploy 1/3 1 1 3s
The Kubernetes namespace in which the Deployments live.
How many replicas of the application are available.
How many replicas of the application are ready.
The number of replicas that have been updated to the desired state.
How long the application has been running.
All, except - The Kubernetes namespace in which the Deployments live.
Which of the following Kubernetes objects is used to store and manage sensitive information?
ConfigMaps
ReplicaSets
Secrets
Service bindings
Secrets
Which of the following can be used to create ConfigMaps? Select the three that apply.
Horizontal Pod Autoscaler A YAML configuration file The kubectl configmap command Service bindings A file with key-value pairs
A YAML configuration file
The kubectl configmap command
A file with key-value pairs
How are ReplicaSets often created?
By adding a ReplicaSet: on flag to the deployment’s configuration file.
Using the kubectl create replicaset command.
One is automatically created for you when you create a Deployment.
By adding a ReplicaSet: on flag to the Dockerfile used to build the container image.
One is automatically created for you when you create a Deployment.
Which of the following Kubernetes objects are used to run applications? Select the three that apply.
Plugins Service bindings Deployments ConfigMaps ResourceSets
Service bindings
Deployments
ConfigMaps
Which of the following are used to provide ConfigMaps to Pods and Deployments? Select the two that apply.
String literals Container runtimes Kubernetes schedulers YAML configuration files Service bindings
String literals
YAML configuration files
What Kubernetes capabilities enable an application to increase the number of Pods based on traffic? Select the two that apply.
Kubernetes traffic router Service binding Horizontal Pod Autoscaler kubectl scale command kubectl autoscale command
Horizontal Pod Autoscaler
kubectl autoscale command
What does the following command do?
kubectl get secrets –namespace=default
Retrieves the binding.password values for the services bound to your Kubernetes cluster
Retrieves the secrets in the “default” namespace
Retrieves all the Secrets in your Kubernetes cluster
Retrieves the IBM Cloud IAM API key for your Kubernetes cluster
Retrieves the secrets in the “default” namespace