Docker & Kubernetes Practice

Practice 80 DevOps questions covering Docker images, containers, volumes, networking, Compose, and Kubernetes workloads, services, storage, and troubleshooting.

Level: Docker & Kubernetes Difficulty: intermediate 80 questions 50 min
Read each Docker or Kubernetes question, choose or type your answer, then check the explanation.
Day streak: 0 days Saved only on this device
Progress 0 / 80
Question 1

What does a Docker image contain?

Select an answer
Question 2

Which Dockerfile instruction sets the base image?

Select an answer
Question 3

Which Dockerfile instruction copies files from the build context into the image?

Select an answer
Question 4

Which command builds an image from a Dockerfile?

Select an answer
Question 5

What does the CMD instruction define?

Select an answer
Question 6

What does the ENTRYPOINT instruction define?

Select an answer
Question 7

What is a Dockerfile?

Select an answer
Question 8

What is a Docker container?

Select an answer
Question 9

Which command lists running containers?

Select an answer
Question 10

Which command starts a container from an image?

Select an answer
Question 11

What does docker pull do?

Select an answer
Question 12

What is Docker Hub?

Select an answer
Question 13

Why does Docker use image layers?

Select an answer
Question 14

What is a Docker volume used for?

Select an answer
Question 15

Which flag is commonly used to mount a volume or bind mount?

Select an answer
Question 16

What is a bind mount?

Select an answer
Question 17

What is a named volume?

Select an answer
Question 18

Which Docker network driver creates an isolated network for containers on one host?

Select an answer
Question 19

Which Docker network driver lets containers use the host network stack directly?

Select an answer
Question 20

What is Docker Compose?

Select an answer
Question 21

Which file is the default Docker Compose file?

Select an answer
Question 22

What does docker compose up do?

Select an answer
Question 23

What is a service in Docker Compose?

Select an answer
Question 24

Which Compose key specifies the image to use?

Select an answer
Question 25

Which Compose key maps host ports to container ports?

Select an answer
Question 26

What does docker exec do?

Select an answer
Question 27

Which command shows logs from a container?

Select an answer
Question 28

What is a container registry?

Select an answer
Question 29

Which command tags an image?

Select an answer
Question 30

Which command uploads an image to a registry?

Select an answer
Question 31

What is a Pod in Kubernetes?

Select an answer
Question 32

Which object maintains a desired number of identical pods?

Select an answer
Question 33

Which controller manages stateless workloads with rolling updates?

Select an answer
Question 34

Which controller runs one pod on every node?

Select an answer
Question 35

Which controller runs a task to completion?

Select an answer
Question 36

Which controller runs scheduled tasks?

Select an answer
Question 37

Which controller is best for stateful applications with stable network identity?

Select an answer
Question 38

What does a Kubernetes Service do?

Select an answer
Question 39

Which Service type exposes a service through a cloud load balancer?

Select an answer
Question 40

What is an Ingress?

Select an answer
Question 41

What is a ConfigMap?

Select an answer
Question 42

What is a Secret?

Select an answer
Question 43

Which command applies a Kubernetes manifest?

Select an answer
Question 44

Which command lists pods in a cluster?

Select an answer
Question 45

Which command shows logs from a pod?

Select an answer
Question 46

What is a namespace in Kubernetes?

Select an answer
Question 47

Where are CPU and memory limits for a container defined?

Select an answer
Question 48

What does a liveness probe check?

Select an answer
Question 49

What does a readiness probe check?

Select an answer
Question 50

What is a PersistentVolumeClaim?

Select an answer
Question 51

Which object defines how storage is provisioned in a cluster?

Select an answer
Question 52

What is kubelet?

Select an answer
Question 53

Which components form the Kubernetes control plane?

Select an answer
Question 54

Which component stores the cluster state?

Select an answer
Question 55

What is a node in Kubernetes?

Select an answer
Question 56

What does the Horizontal Pod Autoscaler do?

Select an answer
Question 57

What does kubectl rollout status show?

Select an answer
Question 58

What is RBAC in Kubernetes?

Select an answer
Question 59

What is a ServiceAccount?

Select an answer
Question 60

What does an image pull policy control?

Select an answer
Question 61

Which of the following are Kubernetes workload controllers?

Select an answer
Question 62

Which fields commonly appear in a Service manifest?

Select an answer
Question 63

Which Docker commands manage images?

Select an answer
Question 64

Which of the following are valid ways to persist data in Docker?

Select an answer
Question 65

Which components are part of the Kubernetes control plane?

Select an answer
Question 66

Which commands help debug a failing pod?

Select an answer
Question 67

Which probes can be defined for a container?

Select an answer
Question 68

Which are valid Kubernetes Service types?

Select an answer
Question 69

Type the Docker command that lists running containers.

Question 70

Type the kubectl command that applies a manifest file.

Question 71

Type the kubectl command that shows logs for a pod named web.

Question 72

Type the Docker command used to run a command inside a running container.

Question 73

Type the kubectl command that shows the status of a Deployment rollout.

Question 74

Type the Kubernetes object that provides a stable network name for pods.

Question 75

Match each Docker command to what it does.

Question 76

Match each Kubernetes object to its purpose.

Question 77

Match each Dockerfile instruction to its purpose.

Question 78

Match each Kubernetes object to its role.

Question 79

Match each kubectl command to what it does.

Question 80

Match each storage concept to its definition.