Docker MCQs with answers Page - 3

Here, you will find a collection of MCQ questions on Docker. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. Which command is used to pull an image from Docker Hub?

  • (A) docker pull
  • (B) docker fetch
  • (C) docker download
  • (D) docker get

A

Admin • 833.24K Points
Coach

Q. What is the purpose of the VOLUME instruction in a Dockerfile?

  • (A) To create a persistent data volume
  • (B) To mount a host directory into the container
  • (C) To define a network volume
  • (D) To specify a shared volume between containers

A

Admin • 833.24K Points
Coach

Q. Which command is used to list all Docker images on the local machine?

  • (A) docker images
  • (B) docker list
  • (C) docker ps
  • (D) docker ls

A

Admin • 833.24K Points
Coach

Q. What is the purpose of the WORKDIR instruction in a Dockerfile?

  • (A) To set the working directory for subsequent instructions
  • (B) To define the user for running commands
  • (C) To specify the base image
  • (D) To copy files into the container

A

Admin • 833.24K Points
Coach

Q. Which command is used to remove a Docker image?

  • (A) docker rmi
  • (B) docker remove
  • (C) docker delete
  • (D) docker erase

A

Admin • 833.24K Points
Coach

Q. What is the purpose of the COPY instruction in a Dockerfile?

  • (A) To copy files from the host to the container
  • (B) To copy files between containers
  • (C) To copy files from the container to the host
  • (D) To create a backup of the container

A

Admin • 833.24K Points
Coach

Q. Which command is used to start a stopped Docker container?

  • (A) docker start
  • (B) docker run
  • (C) docker create
  • (D) docker launch

A

Admin • 833.24K Points
Coach

Q. What is the purpose of the ENV instruction in a Dockerfile?

  • (A) To set environment variables
  • (B) To define the base image
  • (C) To specify the working directory
  • (D) To copy files into the container

A

Admin • 833.24K Points
Coach

Q. Which command is used to inspect a Docker container?

  • (A) docker inspect
  • (B) docker view
  • (C) docker logs
  • (D) docker info

A

Admin • 833.24K Points
Coach

Q. What is the purpose of the USER instruction in a Dockerfile?

  • (A) To define the user for running commands
  • (B) To set environment variables
  • (C) To specify the working directory
  • (D) To copy files into the container

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ