Docker Basics MCQs with Answers and Explanations

Practice Docker Basics MCQs. from DevOps subject. with solved answers and explanations. updated syllabus-based questions.

Search MCQs, Papers, Topics

Loading MCQs...
AI easy

Question 1: What does `docker build` command do?

docker build reads the instructions in a Dockerfile and creates a Docker image layer by layer. The resulting image can then be run as a container or pushed to a registry.

Docker Build Docker Dockerfile Container Image Devops
AI easy

Question 2: Which tool is used to define and manage multi-container Docker applications?

Docker Compose is a tool for defining and running multi-container Docker applications using a docker-compose.yml file. It simplifies orchestration of multiple interdependent services in development environments.

Docker Compose Docker Multi Container Devops Yaml
AI easy

Question 3: In Docker, what command is used to list all running containers?

The docker ps command lists all currently running containers. Adding the -a flag shows all containers including stopped ones.

Docker Container Docker Ps Devops Linux
AI easy

Question 4: What is a "container image" in Docker?

A Docker container image is a read-only template containing the application code, runtime, libraries, and dependencies. Running an image creates a container instance.

Docker Container Image Devops Containerization Image
AI medium

Question 5: What does the `docker-compose up` command do?

docker-compose up reads the docker-compose.yml file, builds images if needed, and starts all defined services as containers. It simplifies managing multi-container applications.

Docker Compose Docker Devops Multi Container Automation
AI easy

Question 6: What is the primary purpose of a Dockerfile?

A Dockerfile is a text file containing instructions to build a Docker image. It defines the base image, dependencies, configuration, and commands needed to run an application in a container.

Dockerfile Docker Container Devops Image Build
AI medium

Question 7: What is the main purpose of Docker containers in deployment workflows?

Docker containers help package applications and dependencies consistently, making them portable across environments.

Docker Deployment Containers Portability
AI medium

Question 8: In Docker, what is an image?

A Docker image is a read-only template used to create containers.

Docker Image Container Devops
AI medium

Question 9: Which statement about containers is correct?

Containers are lightweight and share the host OS kernel, making them more efficient than full virtual machines in many cases.

Containers Docker Virtualization Devops

Showing 1 to 9 of 9 results