Docker Compose MCQs with answers Page - 1

You will find multiple-choice questions (MCQs) related to #Docker Compose here. Go through these questions to prepare effectively for your upcoming exams and interviews.

To view the correct answer for any question, simply click the "Show Answer" button.

Have a question to share? Click on "Add Question" to contribute!

A

Admin • 799.53K Points
Coach

Q. What is the primary purpose of Docker Compose?

  • (A) Building Docker images
  • (B) Managing single-container applications
  • (C) Running multi-container Docker applications
  • (D) Monitoring container logs

A

Admin • 799.53K Points
Coach

Q. What is the default file name Docker Compose looks for?

  • (A) Dockerfile
  • (B) docker-compose.yml
  • (C) compose.yaml
  • (D) services.yml

A

Admin • 799.53K Points
Coach

Q. Which command is used to start services defined in a Compose file?

  • (A) docker-compose build
  • (B) docker-compose run
  • (C) docker-compose up
  • (D) docker-compose start

A

Admin • 799.53K Points
Coach

Q. Which key in docker-compose.yml specifies environment variables?

  • (A) env
  • (B) environment
  • (C) variables
  • (D) config

A

Admin • 799.53K Points
Coach

Q. Which command stops and removes containers, networks, and volumes defined in a Compose file?

  • (A) docker-compose down
  • (B) docker-compose stop
  • (C) docker-compose kill
  • (D) docker-compose remove

A

Admin • 799.53K Points
Coach

Q. Which key in docker-compose.yml is used to define port mappings?

  • (A) ports
  • (B) expose
  • (C) mappings
  • (D) connections

A

Admin • 799.53K Points
Coach

Q. Which key allows specifying the Docker image in docker-compose.yml?

  • (A) dockerfile
  • (B) image
  • (C) build
  • (D) container

A

Admin • 799.53K Points
Coach

Q. What command lists the status of services managed by Docker Compose?

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

A

Admin • 799.53K Points
Coach

Q. Which key defines the restart policy for a service in docker-compose.yml?

  • (A) restart
  • (B) policy
  • (C) on_failure
  • (D) retry

A

Admin • 799.53K Points
Coach

Q. Which key defines dependencies between services?

  • (A) depends_on
  • (B) requires
  • (C) links
  • (D) connections
What's Tag

As you may know, questions are organized under broad categories. Each category can include various types of questions. For example, the "History" category might contain questions about the Revolt of 1857, Shivaji Maharaj, Ancient History, Buddhism, and more.

To further refine this organization, we've introduced tags, which act as sub-categories to group questions more specifically.

Verified users can add tags to any question. If you have any suggestions regarding this system, we'd love to hear from you. Contact Us

Learn More