Docker Compose MCQs with answers Page - 4

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

Q. Which section in docker-compose.yml is used to define named volumes?

  • (A) volumes
  • (B) storage
  • (C) persistent
  • (D) data

A

Admin • 802.91K Points
Coach

Q. What is the purpose of the `tty: true` option in docker-compose.yml?

  • (A) Exposes a port
  • (B) Allocates a pseudo-TTY
  • (C) Maps a volume
  • (D) Limits CPU usage

A

Admin • 802.91K Points
Coach

Q. How can you override settings defined in docker-compose.yml?

  • (A) By editing the Dockerfile
  • (B) By using a docker-compose.override.yml file
  • (C) By using the -p flag
  • (D) By modifying environment variables

A

Admin • 802.91K Points
Coach

Q. Which configuration option is used to run a service with specific user permissions?

  • (A) user
  • (B) permission
  • (C) run_as
  • (D) owner

A

Admin • 802.91K Points
Coach

Q. Which Docker Compose command removes stopped service containers?

  • (A) docker-compose down
  • (B) docker-compose rm
  • (C) docker-compose stop
  • (D) docker-compose clean

A

Admin • 802.91K Points
Coach

Q. What does the `privileged: true` setting enable in docker-compose.yml?

  • (A) Allows root access with all capabilities
  • (B) Enables networking
  • (C) Assigns more memory
  • (D) Disables volume mounting

A

Admin • 802.91K Points
Coach

Q. Which command inspects the configuration of a Compose service?

  • (A) docker-compose config
  • (B) docker-compose inspect
  • (C) docker-compose details
  • (D) docker-compose info

A

Admin • 802.91K Points
Coach

Q. Which section allows for defining constraints on service deployment in Swarm mode?

  • (A) constraints
  • (B) deploy
  • (C) strategy
  • (D) swarm

A

Admin • 802.91K Points
Coach

Q. What does the `scale` option in Docker Compose allow you to do?

  • (A) Increase container memory
  • (B) Run multiple instances of a service
  • (C) Set network policies
  • (D) Attach volumes

A

Admin • 802.91K Points
Coach

Q. Which command shows the configuration in a resolved format from docker-compose.yml?

  • (A) docker-compose show
  • (B) docker-compose config
  • (C) docker-compose inspect
  • (D) docker-compose describe
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