Docker MCQs – Installing Docker

Installing Docker is the first step toward mastering containerization. This topic covers the installation process on various platforms, system requirements, prerequisites, and troubleshooting common installation issues. Knowing these concepts is crucial for both setting up a Docker environment and demonstrating your foundational knowledge in interviews.

These top MCQs are specifically designed to test your understanding of Docker installation and ensure you are well-prepared for technical interviews.

1.) Which of the following is required to install Docker on Linux?

A) An active Docker subscription
B) A system with a hypervisor
C) A Linux distribution with kernel version 3.10 or higher
D) A pre-installed Docker registry

Answer: Option C

Explanation: Docker requires a Linux distribution with kernel version 3.10 or higher to utilize advanced features like namespaces and cgroups.

2.) Which command is used to install Docker on a Debian-based system?

A) apt-get install docker-ce
B) yum install docker
C) apt install docker
D) zypper install docker

Answer: Option A

Explanation: On Debian-based systems like Ubuntu, Docker is installed using the command apt-get install docker-ce (Docker Community Edition).

3.) What is Docker Desktop?

A) A command-line interface for Docker
B) A web-based Docker monitoring tool
C) A GUI-based tool for Docker on Windows and macOS
D) A replacement for Docker Engine

Answer: Option C

Explanation: Docker Desktop is a GUI-based application that allows users to run Docker on Windows and macOS systems.

4.) Which tool is required to run Docker on Windows 10 Home edition?

A) WSL 1
B) WSL 2
C) VirtualBox
D) VMWare Workstation

Answer: Option B

Explanation: Docker requires WSL 2 (Windows Subsystem for Linux 2) to run on Windows 10 Home edition.

5.) How can you verify if Docker is installed correctly on your system?

A) docker run
B) docker test
C) docker verify
D) docker –version

Answer: Option D

Explanation: The command docker –version checks whether Docker is installed and displays the installed version.

6.) Which package manager is used to install Docker on Red Hat-based systems?

A) yum
B) apt
C) zypper
D) pacman

Answer: Option A

Explanation: On Red Hat-based systems like CentOS, Docker is installed using the yum package manager.

7.) What is the purpose of the docker.service file?

A) To store Docker configuration
B) To manage Docker as a systemd service
C) To build Docker images
D) To connect Docker to registries

Answer: Option B

Explanation: The docker.service file is used to manage Docker as a systemd service on Linux-based systems.

8.) What is the default Docker installation directory on Linux?

A) /etc/docker
B) /usr/docker
C) /var/lib/docker
D) /opt/docker

Answer: Option C

Explanation: On Linux, Docker data is stored in /var/lib/docker by default.

9.) What command is used to add Docker’s official GPG key when installing on Linux?

A) curl -fsSL
B) wget -key
C) docker-gpg add
D) sudo key-add docker

Answer: Option A

Explanation: The curl -fsSL command is used to fetch and add Docker’s official GPG key during installation.

10.) What is the default port used by Docker Daemon?

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

Answer: Option C

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

Leave a Reply

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