Docker MCQs – Introduction to Docker

11.) Which of the following is NOT a component of Docker architecture?

A) Docker Engine
B) Docker CLI
C) Docker Daemon
D) Virtual Machine Manager

Answer: Option D

Explanation: Virtual Machine Manager is not a component of Docker architecture. Docker does not rely on traditional VMs.

12.) What is the default port on which Docker Daemon listens for API requests?

A) 22
B) 2375
C) 8080
D) 443

Answer: Option B

Explanation: Docker Daemon listens for API requests on port 2375 by default.

13.) What is the difference between a container and an image?

A) A container is a running instance of an image.
B) An image is a running container.
C) A container is the same as an image.
D) An image cannot be reused, but a container can.

Answer: Option A

Explanation: A container is a running instance of an image, including its application and dependencies.

14.) Which component of Docker is responsible for creating containers?

A) Docker Engine
B) Docker CLI
C) Docker Compose
D) Docker Hub

Answer: Option A

Explanation: Docker Engine is the core component responsible for creating, running, and managing containers.

15.) What is Docker Hub?

A) A tool for monitoring Docker containers
B) A cloud-based registry for Docker images
C) A command-line interface for Docker
D) A physical server for storing Docker data

Answer: Option B

Explanation: Docker Hub is a cloud-based registry service where users can share and manage Docker images.

16.) What is the purpose of the docker pull command?

A) To remove an image
B) To create a new container
C) To list all available images
D) To download an image from a registry

Answer: Option D

Explanation: The docker pull command downloads an image from a Docker registry like Docker Hub.

17.) What is the name of the tool used to define multi-container applications?

A) Docker Hub
B) Docker CLI
C) Docker Compose
D) Docker Engine

Answer: Option C

Explanation: Docker Compose is used to define and run multi-container Docker applications.

18.) How does Docker ensure efficient use of system resources?

A) By creating virtual machines
B) By using a shared kernel and containerization
C) By running all containers on different hosts
D) By allocating fixed memory to containers

Answer: Option B

Explanation: Docker uses containerization and a shared kernel to optimize resource usage, making it more efficient than virtual machines.

19.) What does Docker use to optimize image layers?

A) Virtual memory
B) Layer caching
C) Hypervisor technology
D) Volume mapping

Answer: Option B

Explanation: Docker uses layer caching to optimize and speed up the build process by reusing unchanged layers.

20.) Which of the following best describes a Dockerfile?

A) A script for managing Docker networks
B) A log file for tracking container events
C) A configuration file for Docker CLI
D) A template for creating Docker images

Answer: Option A

Explanation: A Dockerfile is a script containing a set of instructions for building a Docker image.

Leave a Reply

Your email address will not be published. Required fields are marked *