Docker MCQs with answers Page - 20

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 • 832.27K Points
Coach

Q. Which of the following Docker commands is used to remove a specific image?

  • (A) docker rm image_name
  • (B) docker rmi image_name
  • (C) docker remove image_name
  • (D) docker image rm image_name

A

Admin • 832.27K Points
Coach

Q. What is Docker Compose primarily used for?

  • (A) Building images from a Dockerfile
  • (B) Defining and running multi-container Docker applications
  • (C) Running a single container application
  • (D) Orchestrating containers across multiple hosts

A

Admin • 832.27K Points
Coach

Q. Which of the following options is used to pass environment variables to a Docker container?

  • (A) -e
  • (B) --env
  • (C) --env-file
  • (D) All of the above

A

Admin • 832.27K Points
Coach

Q. What is the role of the Docker daemon?

  • (A) To manage and run Docker containers
  • (B) To configure Docker settings
  • (C) To monitor Docker images
  • (D) To create Docker images

A

Admin • 832.27K Points
Coach

Q. Which command is used to remove a running container?

  • (A) docker stop -f
  • (B) docker rm -f
  • (C) docker remove -f
  • (D) docker kill -f

A

Admin • 832.27K Points
Coach

Q. Which of the following is true about Docker volumes?

  • (A) Volumes persist data across container restarts
  • (B) Volumes are ephemeral and get deleted when the container is deleted
  • (C) Volumes are only accessible inside the container
  • (D) Volumes are used for storing images

A

Admin • 832.27K Points
Coach

Q. Which of the following commands is used to pull a Docker image from Docker Hub?

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

A

Admin • 832.27K Points
Coach

Q. What is the default port for the Docker daemon?

  • (A) 8080
  • (B) 2375
  • (C) 443
  • (D) 5000

A

Admin • 832.27K Points
Coach

Q. What is the purpose of the 'docker exec' command?

  • (A) To execute a command inside a running container
  • (B) To create a new container
  • (C) To stop a running container
  • (D) To list running containers

A

Admin • 832.27K Points
Coach

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

  • (A) docker images
  • (B) docker list images
  • (C) docker show images
  • (D) docker image list

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