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!

Q1

Q1 What is Docker primarily used for?

A

To manage databases

B

To create, deploy, and run applications in containers

C

To automate software testing

D

To build mobile apps

Q2

Q2 What is a Docker container?

A

A lightweight virtual machine

B

A runtime instance of a Docker image

C

A storage unit

D

A command-line tool

Q3

Q3 Which of the following best describes Docker images?

A

Images are templates used to create containers

B

Images are running instances of containers

C

Images store application logs

D

Images are always public

Q4

Q4 What does the Docker CLI do?

A

Provides a GUI for Docker

B

Communicates with the Docker Daemon

C

Executes containerized applications

D

Stores Docker images

Q5

Q5 Which of these commands is used to start Docker?

A

docker start

B

docker run

C

systemctl start docker

D

docker service start

Q6

Q6 What differentiates containers from virtual machines?

A

Containers virtualize the OS while VMs virtualize hardware

B

Containers are heavier than VMs

C

Containers require hypervisors

D

Containers cannot be used in production

Q7

Q7 Which company originally developed Docker?

A

Red Hat

B

Canonical

C

Docker Inc.

D

IBM

Q8

Q8 What is the primary advantage of using Docker containers?

A

They are cheaper than VMs

B

They provide better network speed

C

They ensure consistent application environments

D

They are faster than any other virtualization method

Q9

Q9 Which command is used to list all running containers?

A

docker ps

B

docker images

C

docker list

D

docker show

Q10

Q10 You run the command 'docker run -p 80:80 nginx', but the container fails to start. The logs show 'port already in use.' What should you do?

A

Use a different port

B

Restart Docker

C

Rebuild the image

D

Stop the conflicting process

Q11

Q11 What is the role of the Docker Daemon?

A

Provides a GUI for managing containers

B

Executes commands sent by the CLI

C

Manages Docker objects like images, containers, and networks

D

Stores data for containers

Q12

Q12 Which component of Docker is responsible for interacting with users?

A

Docker CLI

B

Docker Registry

C

Docker Engine

D

Docker Daemon

Q13

Q13 What is the primary purpose of the Docker Registry?

A

To manage container networking

B

To store and distribute Docker images

C

To execute commands sent by the CLI

D

To monitor container performance

Q14

Q14 What does the Docker Engine consist of?

A

CLI, Daemon, and REST API

B

CLI and Registry

C

Images and Containers

D

Only the Docker CLI

Q15

Q15 What is the function of the REST API in Docker?

A

To create container volumes

B

To interact programmatically with the Docker Daemon

C

To monitor container performance

D

To store Docker images

Q16

Q16 How does the Docker Daemon handle requests?

A

Directly executes commands

B

Delegates tasks to CLI

C

Processes requests via the REST API

D

Stores images temporarily

Q17

Q17 Which component is responsible for pulling images from a Docker Registry?

A

Docker CLI

B

Docker Daemon

C

Docker Engine

D

REST API

Q18

Q18 Which command checks the status of the Docker Daemon?

A

docker ps

B

docker status

C

systemctl status docker

D

docker info

Q19

Q19 The Docker CLI cannot connect to the Docker Daemon. What should you check first?

A

The container logs

B

The image configuration

C

The Docker service status

D

The network settings

Q20

Q20 Which command is used to install Docker on a Linux system?

A

apt-get install docker-ce

B

yum install docker

C

brew install docker

D

All of the above

Q21

Q21 What is the default port used by Docker Daemon?

A

2375

B

2376

C

8080

D

80

Q22

Q22 Which file is used to configure Docker during installation?

A

docker-compose.yml

B

config.json

C

daemon.json

D

dockerfile

Q23

Q23 How do you check the version of Docker installed?

A

docker --check

B

docker version

C

docker --info

D

docker config

Q24

Q24 Which flag is used with the 'docker run' command to run a container in detached mode?

A

-it

B

-d

C

-rm

D

-p

Q25

Q25 What does the 'docker pull' command do?

A

Creates a container

B

Removes an image

C

Downloads an image from a registry

D

Updates Docker CLI

Q26

Q26 What is the use of the 'docker info' command?

A

To display Docker configuration and system information

B

To run a container

C

To restart Docker

D

To update Docker

Q27

Q27 How do you start a stopped container?

A

docker run

B

docker start

C

docker restart

D

docker init

Q28

Q28 Which command lists all Docker images available locally?

A

docker ps

B

docker images

C

docker list

D

docker pull

Q29

Q29 You get an error 'Cannot connect to the Docker Daemon.' What is the likely cause?

A

Docker Daemon is not running

B

Wrong Docker command

C

Network issue

D

Image not found

Q30

Q30 A container fails to start due to insufficient memory. What can you do?

A

Increase system memory

B

Use the --memory flag to allocate more memory

C

Rebuild the container

D

Stop all running containers

ad verticalad vertical
ad