Docker MCQs with answers Page - 5

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

Q. Which command is used to create a Docker network?

  • (A) docker network create
  • (B) docker create network
  • (C) docker net create
  • (D) docker add network

A

Admin • 802.91K Points
Coach

Q. What is the purpose of the SHELL instruction in a Dockerfile?

  • (A) To specify the default shell for the container
  • (B) To define the base image
  • (C) To specify the working directory
  • (D) To copy files into the container

A

Admin • 802.91K Points
Coach

Q. Which command is used to list Docker networks?

  • (A) docker network ls
  • (B) docker list networks
  • (C) docker net ls
  • (D) docker show networks

A

Admin • 802.91K Points
Coach

Q. What is the purpose of the ADD instruction in a Dockerfile?

  • (A) To copy files from the host to the container
  • (B) To copy files between containers
  • (C) To copy files from the container to the host
  • (D) To create a backup of the container

A

Admin • 802.91K Points
Coach

Q. Which command is used to remove a Docker network?

  • (A) docker network rm
  • (B) docker remove network
  • (C) docker net rm
  • (D) docker delete network

A

Admin • 802.91K Points
Coach

Q. What is Docker Compose used for?

  • (A) Building Docker images
  • (B) Managing multi-container applications
  • (C) Monitoring Docker containers
  • (D) Creating container snapshots

A

Admin • 802.91K Points
Coach

Q. Which file format does Docker Compose use?

  • (A) JSON
  • (B) YAML
  • (C) XML
  • (D) INI

A

Admin • 802.91K Points
Coach

Q. What is the default name of the Docker Compose configuration file?

  • (A) docker-compose.yml
  • (B) compose.json
  • (C) dockerfile.yaml
  • (D) config.compose

A

Admin • 802.91K Points
Coach

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

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

A

Admin • 802.91K Points
Coach

Q. How can you run Docker Compose in detached mode?

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

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