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!

Q61

Q61 How do you create a named volume in Docker?

A

docker create volume

B

docker volume create

C

docker volume new

D

docker volume init

Q62

Q62 How do you mount a volume to a Docker container?

A

docker run -v :

B

docker mount :

C

docker volume :

D

docker attach

Q63

Q63 How do you remove an unused Docker volume?

A

docker remove volume

B

docker volume rm

C

docker clean volume

D

docker volume prune

Q64

Q64 How do you remove all unused Docker volumes?

A

docker volume prune

B

docker clean volumes

C

docker volume rm all

D

docker remove unused volumes

Q65

Q65 What should you check if a container cannot write to a mounted volume?

A

Container logs

B

Volume permissions

C

Docker Daemon

D

Volume name

Q66

Q66 You get an error 'volume is in use by a container.' How can you resolve this?

A

Stop the container using the volume

B

Recreate the volume

C

Rename the volume

D

Restart Docker

Q67

Q67 A container fails to start due to a missing volume. What should you do?

A

Recreate the volume

B

Restart Docker

C

Rebuild the container

D

Inspect the container logs

Q68

Q68 What is the default Docker network type?

A

bridge

B

host

C

none

D

overlay

Q69

Q69 What is the purpose of the Docker 'host' network?

A

Provides no networking

B

Connects containers to an external network

C

Uses the host's network stack directly

D

Creates an isolated network

Q70

Q70 Which command lists all Docker networks?

A

docker network list

B

docker network ls

C

docker networks

D

docker network show

Q71

Q71 What is the purpose of an 'overlay' network in Docker?

A

For standalone containers

B

For host-only networking

C

For multi-host container communication

D

For connecting to external networks

Q72

Q72 What is the key difference between 'bridge' and 'none' network types?

A

Bridge allows external communication, while none isolates containers

B

None uses host networking

C

Bridge is for multi-host networks

D

None is a deprecated network type

Q73

Q73 How do you inspect a specific Docker network?

A

docker inspect network

B

docker network inspect

C

docker show network

D

docker network info

Q74

Q74 How do you connect a container to a specific network?

A

docker network add

B

docker connect

C

docker network connect

D

docker attach network

Q75

Q75 How do you create a custom Docker network?

A

docker network new

B

docker network create

C

docker create network

D

docker new network

Q76

Q76 How do you disconnect a container from a network?

A

docker network disconnect

B

docker disconnect

C

docker network remove

D

docker detach network

Q77

Q77 What should you check if a container cannot connect to a network?

A

Container logs

B

Network connection status

C

DNS settings

D

Docker version

Q78

Q78 A container cannot resolve DNS queries. What might be the issue?

A

The host DNS is misconfigured

B

The container is stopped

C

The Docker service is down

D

The container is not part of a network

Q79

Q79 Multi-host communication fails in an overlay network. What should you check?

A

Firewall settings

B

Docker version

C

Container logs

D

Host operating system

Q80

Q80 What is Docker Compose primarily used for?

A

Building Docker images

B

Orchestrating multi-container applications

C

Monitoring Docker containers

D

Managing Docker networks

Q81

Q81 Which file is typically used to define a Docker Compose configuration?

A

compose.yml

B

docker-compose.yml

C

config.yaml

D

application.yml

Q82

Q82 Which command is used to start all services defined in a Docker Compose file?

A

docker-compose run

B

docker-compose start

C

docker-compose up

D

docker start compose

Q83

Q83 What is the default network created by Docker Compose?

A

host

B

none

C

overlay

D

bridge

Q84

Q84 What does the 'depends_on' key in a Docker Compose file specify?

A

Service dependencies

B

Container startup order

C

Volumes to be mounted

D

Network configurations

Q85

Q85 How do you stop all running services in a Docker Compose application?

A

docker-compose down

B

docker-compose stop

C

docker-compose terminate

D

docker stop compose

Q86

Q86 How do you remove all services and associated resources in a Docker Compose application?

A

docker-compose clean

B

docker-compose down

C

docker-compose remove

D

docker-compose rm

Q87

Q87 How do you scale a service to run 3 instances in Docker Compose?

A

docker-compose scale =3

B

docker-compose up -d --scale =3

C

docker-compose add =3

D

docker-compose expand =3

Q88

Q88 How do you view logs for all services in a Docker Compose application?

A

docker-compose logs

B

docker-compose show logs

C

docker-compose inspect logs

D

docker logs compose

Q89

Q89 What should you check if a service fails to start in Docker Compose?

A

Compose file syntax

B

Docker version

C

Network settings

D

Host operating system

Q90

Q90 A service in Docker Compose is unable to communicate with another service. What might be the issue?

A

Incorrect Docker Compose version

B

Service not part of the same network

C

Service dependencies not defined

D

Host machine firewall

ad verticalad vertical
ad