Docker MCQs with answers Page - 7

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

Q. Which command is used to list all running services in Docker Compose?

  • (A) docker-compose ps
  • (B) docker-compose list
  • (C) docker-compose status
  • (D) docker-compose show

A

Admin • 831.35K Points
Coach

Q. What is the purpose of 'volumes' in a Docker Compose file?

  • (A) To mount external files into containers
  • (B) To specify environment variables
  • (C) To define services
  • (D) To scale the services

A

Admin • 831.35K Points
Coach

Q. Which of the following is NOT a valid service type in Docker Compose?

  • (A) Build
  • (B) Run
  • (C) Network
  • (D) Volume

A

Admin • 831.35K Points
Coach

Q. How do you define the network settings for a service in Docker Compose?

  • (A) Using the 'networks' key
  • (B) Using the 'link' key
  • (C) Using the 'connections' key
  • (D) Using the 'network' key

A

Admin • 831.35K Points
Coach

Q. What is the default network mode for services in Docker Compose?

  • (A) bridge
  • (B) host
  • (C) none
  • (D) overlay

A

Admin • 831.35K Points
Coach

Q. Which of the following commands is used to execute a command inside a running Docker Compose container?

  • (A) docker-compose exec
  • (B) docker exec
  • (C) docker-compose run
  • (D) docker-compose command

A

Admin • 831.35K Points
Coach

Q. How do you configure a custom Docker Compose file name?

  • (A) Using the '--file' flag
  • (B) Using the '--config' flag
  • (C) Using the '--name' flag
  • (D) Using the '--compose' flag

A

Admin • 831.35K Points
Coach

Q. Which command is used to check the status of all services in Docker Compose?

  • (A) docker-compose status
  • (B) docker-compose show
  • (C) docker-compose ps
  • (D) docker-compose check

A

Admin • 831.35K Points
Coach

Q. What does the 'docker-compose build' command do?

  • (A) Rebuilds the services defined in the Compose file
  • (B) Starts the services
  • (C) Shows the service status
  • (D) Scales the services

A

Admin • 831.35K Points
Coach

Q. Which command removes stopped containers, networks, and volumes created by Docker Compose?

  • (A) docker-compose prune
  • (B) docker-compose clean
  • (C) docker-compose down --volumes
  • (D) docker-compose destroy

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