Docker - ENG - Coursera Flashcards

1
Q

What does the Docker CLI run command do?

A

It runs an image as a container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In this sample Dockerfile, what does the COPY instruction do?

FROM ubuntu:18.04

COPY . /app

RUN make /app

CMD python /app/app.py

A

It copies the contents of the current directory into the /app directory of the image as a new layer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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 .

A

docker build -t my-app:v1 .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

You can use the Docker COPY instruction to copy files both from your local machine and from remote URLs.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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.

A

Containers provide a standardized way to package and ship software.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A read-only file that contains the source code, libraries, and dependencies that are needed to run an application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In this sample Dockerfile, what does the FROM instruction do?

FROM ubuntu:18.04

COPY . /app

RUN make /app

CMD python /app/app.py

A

It defines the base image, which in this case is Ubuntu version 18.04.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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.

A

It uses a Dockerfile to create an image.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

You can use the Docker COPY instruction to copy files from your local machine to an image.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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.
A

It builds an image from a Dockerfile.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Containers include a guest operating system in every instance.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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.

A

It gives the image the name “my-app” and the tag “v1”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

You use the docker push command to distribute an image to a registry.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the following is not handled by Kubernetes?

Scaling
Performing health checks
Provisioning and deployment
Automating app integration

A

Automating app integration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the following two are container runtimes? Select all that apply.

CRI-O
Correct
rocket
DRunner
Kubernetes
Docker
A

CRI-O

Docker

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A namespace is a Kubernetes object that can be used to segregate a cluster by team or project.

True
False

A

True

17
Q

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

A

Pods and ReplicaSets

18
Q

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

A

kubectl create -f pod.json

19
Q

Before you create a Deployment, you must create the associated ReplicaSet.

True
False

A

False

20
Q

You can use a SecretMap to store and manage sensitive information, such as passwords.

True
False

A

False

21
Q

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
A

YAML configuration files

String literals

22
Q

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.

A

Automatically increases or decreases the number of Pods deployed within the system as needed

23
Q

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

A

kubectl get secrets –namespace=default

24
Q

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

A

All, except - Autoscales an application

25
Q

Which of the following Kubernetes objects are used to run applications? Select the four that apply.

ReplicaSets 
ibmcloud CLI 
ConfigMaps 
Secrets 
Service bindings
A

All, except - ibmcloud CLI

26
Q

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.

A

All, except - The Kubernetes namespace in which the Deployments live.

27
Q

Which of the following Kubernetes objects is used to store and manage sensitive information?

ConfigMaps
ReplicaSets
Secrets
Service bindings

A

Secrets

28
Q

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

A YAML configuration file
The kubectl configmap command
A file with key-value pairs

29
Q

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.

A

One is automatically created for you when you create a Deployment.

30
Q

Which of the following Kubernetes objects are used to run applications? Select the three that apply.

Plugins 
Service bindings 
Deployments 
ConfigMaps 
ResourceSets
A

Service bindings
Deployments
ConfigMaps

31
Q

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
A

String literals

YAML configuration files

32
Q

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
A

Horizontal Pod Autoscaler 

kubectl autoscale command

33
Q

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

A

Retrieves the secrets in the “default” namespace