Explore essential Docker MCQ questions and answers tailored for beginners and professionals. Learn about containerization concepts, Docker installation across platforms, its architecture, and fundamental commands. Delve into Docker Hub and image repositories, equipping yourself with the knowledge to manage containerized applications effectively. Perfect for mastering Docker fundamentals through interactive multiple-choice questions.
MCQs: Chapter 1 – Getting Started with Docker
Topic: Introduction to Containerization
What is containerization in the context of software development? a. A method for deploying virtual machines b. Running applications in isolated environments c. A tool for testing applications d. A hardware abstraction technique
Which of the following is a primary advantage of containerization? a. Increased hardware costs b. Lightweight and portable environments c. Dependency on hypervisors d. Reduced application performance
What is the difference between a virtual machine and a container? a. Virtual machines use less memory than containers b. Containers run on top of the host OS without a full guest OS c. Containers require more resources than virtual machines d. Virtual machines do not include the operating system
Which popular platform is most commonly used for containerization? a. Kubernetes b. Docker c. Ansible d. Jenkins
Containers are beneficial for: a. Hardware virtualization b. Developing and deploying applications consistently across environments c. Managing multiple operating systems d. Creating physical backups of servers
A Docker container includes: a. The operating system kernel and hardware drivers b. Application code, libraries, and dependencies c. A full-fledged operating system d. Only application code
Topic: Installing Docker on Windows, macOS, and Linux
Which command is commonly used to install Docker on Linux? a. apt-get install docker b. install docker-cli c. yum docker-setup d. docker install
What is required to install Docker Desktop on Windows? a. An active Windows Defender subscription b. Hyper-V or WSL2 enabled on the system c. A 32-bit operating system d. .NET Framework 4.0
For macOS, Docker Desktop requires: a. macOS High Sierra or later versions b. Java runtime installed c. A dedicated container management software d. No installation
Which Linux distributions are officially supported by Docker? a. Ubuntu, CentOS, and Fedora b. Arch Linux and Manjaro c. Mint Linux and Debian only d. OpenSUSE and Red Hat exclusively
On Windows, which backend technology does Docker Desktop use for virtualization? a. VirtualBox b. Hyper-V or WSL2 c. VMware Workstation d. QEMU
How can you verify if Docker is installed successfully? a. Running the docker check command b. Executing docker --version in the terminal c. Checking for Docker in the Control Panel d. Opening Docker Desktop
Topic: Understanding Docker Architecture
What is the primary function of the Docker Engine? a. Provides a graphical interface for managing containers b. Creates and manages Docker containers c. Monitors system performance d. Converts VMs into containers
Which component acts as the interface between the user and the Docker Engine? a. Docker CLI b. Docker Hub c. Docker Daemon d. Docker Registry
What is the role of the Docker Daemon? a. Execute commands from the Docker CLI b. Store Docker images c. Provide container orchestration services d. Manage Docker container lifecycles
The Docker CLI is used for: a. Running containerized applications interactively b. Creating and managing Docker images and containers c. Storing container logs d. Monitoring Docker network traffic
Docker containers communicate with the Docker Daemon through: a. A REST API b. A WebSocket connection c. Command-line arguments d. Internal messaging queues
Which of these is NOT a part of Docker architecture? a. Docker Hub b. Docker Registry c. Docker Kernel d. Docker CLI
Topic: Basic Docker Commands
Which command is used to pull a Docker image from Docker Hub? a. docker download b. docker pull c. docker get d. docker fetch
How do you start a Docker container? a. docker launch b. docker begin c. docker run d. docker start-container
Which command lists all running containers? a. docker list-containers b. docker status c. docker ps d. docker ls
To remove a Docker container, you use the command: a. docker delete b. docker remove c. docker rm d. docker stop
How do you stop a running Docker container? a. docker halt b. docker stop c. docker pause d. docker kill
What does the docker images command do? a. Lists all images on the local machine b. Deletes unused images c. Starts a container from an image d. Pulls images from Docker Hub
Topic: Docker Hub and Image Repositories
What is Docker Hub? a. A command-line tool for Docker b. A cloud-based repository for Docker images c. A service to monitor container health d. An alternative to Docker Desktop
What is the default registry used by Docker? a. Docker Cloud b. Docker Hub c. GitHub Packages d. Azure Container Registry
Which command pushes an image to Docker Hub? a. docker push b. docker deploy c. docker upload d. docker publish
What is required to upload images to Docker Hub? a. Administrator permissions b. An active Docker Hub account c. A secure shell (SSH) connection d. A local image registry
Private repositories in Docker Hub: a. Are only accessible to the public b. Allow restricted access for specific users c. Cannot be created by users d. Are only available on the free tier
Which of the following best describes an image in Docker? a. A snapshot of a running container b. A lightweight, stand-alone, and executable package containing application code and dependencies c. A graphical representation of the system d. A text-based configuration file
Answer Key
QNo
Answer
1
b. Running applications in isolated environments
2
b. Lightweight and portable environments
3
b. Containers run on top of the host OS without a full guest OS
4
b. Docker
5
b. Developing and deploying applications consistently across environments
6
b. Application code, libraries, and dependencies
7
a. apt-get install docker
8
b. Hyper-V or WSL2 enabled on the system
9
a. macOS High Sierra or later versions
10
a. Ubuntu, CentOS, and Fedora
11
b. Hyper-V or WSL2
12
b. Executing docker --version in the terminal
13
b. Creates and manages Docker containers
14
a. Docker CLI
15
d. Manage Docker container lifecycles
16
b. Creating and managing Docker images and containers
17
a. A REST API
18
c. Docker Kernel
19
b. docker pull
20
c. docker run
21
c. docker ps
22
c. docker rm
23
b. docker stop
24
a. Lists all images on the local machine
25
b. A cloud-based repository for Docker images
26
b. Docker Hub
27
a. docker push
28
b. An active Docker Hub account
29
b. Allow restricted access for specific users
30
b. A lightweight, stand-alone, and executable package containing application code and dependencies