Docker Compose MCQs with answers Page - 5

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

Q. Which key in docker-compose.yml sets memory limits for services?

  • (A) memory_limit
  • (B) mem_limit
  • (C) deploy.resources.limits.memory
  • (D) resources.memory

A

Admin • 828.03K Points
Coach

Q. Which command updates running services after changes in the docker-compose.yml?

  • (A) docker-compose up --build
  • (B) docker-compose restart
  • (C) docker-compose refresh
  • (D) docker-compose rebuild

A

Admin • 828.03K Points
Coach

Q. What is the `profiles` key used for in docker-compose.yml?

  • (A) To manage networks
  • (B) To define service configurations based on environments
  • (C) To set CPU limits
  • (D) To define restart policies

A

Admin • 828.03K Points
Coach

Q. What will `docker-compose down --volumes` do?

  • (A) Remove containers only
  • (B) Remove containers and networks
  • (C) Remove containers, networks, and volumes
  • (D) Only stop the services

A

Admin • 828.03K Points
Coach

Q. What is the default network driver in Docker Compose?

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

A

Admin • 828.03K Points
Coach

Q. What does the `entrypoint` key in docker-compose.yml do?

  • (A) Overrides the default container command
  • (B) Specifies the image to build
  • (C) Defines service dependencies
  • (D) Exposes container ports

A

Admin • 828.03K Points
Coach

Q. Which section defines how to attach to external networks in Compose?

  • (A) external_networks
  • (B) networks with external: true
  • (C) bridge_network
  • (D) custom_networks

A

Admin • 828.03K Points
Coach

Q. How do you specify a custom name for a service container in docker-compose.yml?

  • (A) container_name
  • (B) custom_name
  • (C) name_override
  • (D) alias

A

Admin • 828.03K Points
Coach

Q. Which Docker Compose command stops all services without removing them?

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

A

Admin • 828.03K Points
Coach

Q. What does the `logging` key configure in docker-compose.yml?

  • (A) Network settings
  • (B) Log driver and options
  • (C) Restart policies
  • (D) Environment variables
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