Docker MCQ Banner

Docker Multiple Choice Questions (MCQs) and Answers

Master Docker with Practice MCQs. Explore our curated collection of Multiple Choice Questions. Ideal for placement and interview preparation, our questions range from basic to advanced, ensuring comprehensive coverage of Docker concepts. Begin your placement preparation journey now!

Q91

Q91 How can you troubleshoot a failing service in Docker Compose?

A

Inspect service logs

B

Recreate the Compose file

C

Restart Docker

D

Remove unused networks

Q92

Q92 What is Docker Hub?

A

A tool for building images

B

A cloud-based Docker registry

C

A command-line utility

D

A networking tool

Q93

Q93 What is the primary purpose of a Docker Registry?

A

To monitor Docker containers

B

To store and distribute Docker images

C

To build multi-container applications

D

To manage Docker networks

Q94

Q94 Which of the following is a public Docker registry?

A

Docker Hub

B

AWS Elastic Container Registry

C

Google Container Registry

D

All of the above

Q95

Q95 What is the difference between a public and a private registry?

A

Public registries require authentication

B

Private registries are always cloud-based

C

Public registries are accessible to anyone, while private registries are restricted

D

Private registries cannot be used in production

Q96

Q96 How does a self-hosted Docker Registry differ from Docker Hub?

A

Self-hosted registries provide more features

B

Docker Hub requires no setup

C

Self-hosted registries are used for private images only

D

Docker Hub does not support public images

Q97

Q97 How do you log in to a Docker registry?

A

docker registry login

B

docker login

C

docker login registry

D

docker authenticate

Q98

Q98 How do you push an image to a Docker registry?

A

docker push

B

docker registry push

C

docker image push

D

docker upload

Q99

Q99 How do you pull an image from a Docker registry?

A

docker pull

B

docker registry pull

C

docker download

D

docker get

Q100

Q100 How do you list all tags for an image in a Docker registry?

A

docker registry tags

B

docker image tags

C

docker pull --tags

D

docker inspect tags

Q101

Q101 What should you check if a Docker image fails to push to a registry?

A

Registry URL

B

Docker image version

C

Authentication credentials

D

All of the above

Q102

Q102 A Docker pull command fails with 'unauthorized' error. What might be the issue?

A

The image does not exist

B

Incorrect registry URL

C

Invalid credentials

D

The registry is offline

Q103

Q103 You encounter slow upload speeds when pushing images to a Docker registry. What could be a reason?

A

High network latency

B

Docker Daemon misconfiguration

C

Registry authentication

D

Image size too small

Q104

Q104 What is the primary purpose of using Docker secrets?

A

Store sensitive information

B

Manage container logs

C

Monitor container performance

D

Debug networking issues

Q105

Q105 Why is it recommended to run containers with non-root users?

A

For better performance

B

To avoid privilege escalation

C

To improve networking

D

To reduce memory usage

Q106

Q106 What is the role of image signing in Docker security?

A

To encrypt container traffic

B

To verify the authenticity of images

C

To improve image performance

D

To manage image storage

Q107

Q107 What is the purpose of Docker Content Trust (DCT)?

A

To monitor container activity

B

To enforce signed image verification

C

To optimize container builds

D

To manage container logs

Q108

Q108 How do you enable Docker Content Trust?

A

Set DOCKER_TRUST=1

B

Set DOCKER_CONTENT_TRUST=1

C

Enable trust in Docker settings

D

Use the --trust flag with Docker commands

Q109

Q109 How do you scan a Docker image for vulnerabilities?

A

docker inspect

B

docker image scan

C

docker scan

D

docker image verify

Q110

Q110 How do you limit memory usage for a container?

A

Use the --mem-limit flag

B

Use the --memory flag

C

Set memory_limit in docker-compose.yml

D

Set max_mem in the Dockerfile

Q111

Q111 What should you do if a container is accessing restricted resources?

A

Restart the container

B

Check and update security policies

C

Stop all other containers

D

Inspect the container logs

Q112

Q112 How do you troubleshoot unauthorized access attempts in Docker?

A

Inspect Docker logs

B

Rebuild the container

C

Update Docker to the latest version

D

Restart the Docker Daemon

Q113

Q113 What is Docker Swarm primarily used for?

A

Container storage management

B

Networking between containers

C

Container orchestration

D

Monitoring container performance

Q114

Q114 What is the role of a manager node in Docker Swarm?

A

Handles container storage

B

Schedules tasks and manages cluster state

C

Executes container workloads

D

Manages container logs

Q115

Q115 What is the default communication protocol used in Docker Swarm?

A

HTTP

B

gRPC

C

Raft

D

UDP

Q116

Q116 How does Docker Swarm ensure high availability?

A

By using multiple manager nodes

B

By distributing storage

C

By enabling persistent volumes

D

By isolating network traffic

Q117

Q117 How do you initialize a Docker Swarm?

A

docker swarm init

B

docker init swarm

C

docker swarm create

D

docker swarm start

Q118

Q118 How do you add a worker node to a Docker Swarm?

A

docker swarm add-worker

B

docker swarm join --role worker

C

docker swarm connect

D

docker join swarm --worker

Q119

Q119 How do you list all nodes in a Docker Swarm?

A

docker node ls

B

docker swarm list-nodes

C

docker swarm nodes

D

docker list nodes

Q120

Q120 What should you check if a Docker Swarm service fails to deploy?

A

Node logs

B

Service definition

C

Network connectivity

D

All of the above

ad verticalad vertical
ad