Docker Compose MCQs with answers Page - 3

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 command resumes services that were paused using Docker Compose?

  • (A) docker-compose continue
  • (B) docker-compose up
  • (C) docker-compose unpause
  • (D) docker-compose resume

A

Admin • 828.03K Points
Coach

Q. Which file format version key is used to specify the version in docker-compose.yml?

  • (A) file_version
  • (B) version
  • (C) compose_version
  • (D) docker_version

A

Admin • 828.03K Points
Coach

Q. Which key in docker-compose.yml defines build context?

  • (A) context
  • (B) path
  • (C) source
  • (D) build_context

A

Admin • 828.03K Points
Coach

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

  • (A) Specifies ports to expose
  • (B) Creates volumes
  • (C) Builds a Docker image from a specified context
  • (D) Defines service dependencies

A

Admin • 828.03K Points
Coach

Q. Which command would remove all stopped containers, networks not used by at least one container, and dangling images?

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

A

Admin • 828.03K Points
Coach

Q. What is the effect of `docker-compose up --build`?

  • (A) Stops and removes containers
  • (B) Builds images before starting containers
  • (C) Lists running containers
  • (D) Updates the Docker engine

A

Admin • 828.03K Points
Coach

Q. What is specified by the `command` key in docker-compose.yml?

  • (A) The Docker image to use
  • (B) The command to run inside the container
  • (C) Network settings
  • (D) Volume settings

A

Admin • 828.03K Points
Coach

Q. Which key is used to specify a custom network driver in docker-compose.yml?

  • (A) driver
  • (B) network_driver
  • (C) bridge
  • (D) adapter

A

Admin • 828.03K Points
Coach

Q. How can you limit CPU usage for a service in docker-compose.yml?

  • (A) cpus
  • (B) cpu_limit
  • (C) resources
  • (D) limits

A

Admin • 828.03K Points
Coach

Q. Which command is used to restart containers without stopping them first?

  • (A) docker-compose restart
  • (B) docker-compose refresh
  • (C) docker-compose rebuild
  • (D) docker-compose update
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