Docker MCQs with answers Page - 13

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

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

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

A

Admin • 833.24K Points
Coach

Q. How can you scale a service in Docker Compose?

  • (A) Using the 'scale' option
  • (B) By modifying the service definition in the Compose file
  • (C) Using the 'docker-compose scale' command
  • (D) All of the above

A

Admin • 833.24K Points
Coach

Q. What is the 'docker-compose down' command used for?

  • (A) To bring down a Docker container
  • (B) To stop and remove containers, networks, and volumes
  • (C) To view running services
  • (D) To build the Compose file

A

Admin • 833.24K Points
Coach

Q. Which of the following Docker commands is used to pull an image from a remote registry?

  • (A) docker push
  • (B) docker fetch
  • (C) docker pull
  • (D) docker get

A

Admin • 833.24K Points
Coach

Q. What is the default command that Docker runs in a container if no command is specified?

  • (A) CMD
  • (B) ENTRYPOINT
  • (C) RUN
  • (D) BOTH CMD AND ENTRYPOINT

A

Admin • 833.24K Points
Coach

Q. Which command is used to view Docker system-wide information?

  • (A) docker info
  • (B) docker details
  • (C) docker system info
  • (D) docker status

A

Admin • 833.24K Points
Coach

Q. What is the main benefit of using Docker over virtual machines?

  • (A) Docker is faster and more lightweight
  • (B) Docker provides better isolation than virtual machines
  • (C) Docker is not dependent on hardware resources
  • (D) Docker can run on multiple operating systems without issue

A

Admin • 833.24K Points
Coach

Q. Which command is used to push a Docker image to Docker Hub?

  • (A) docker push
  • (B) docker upload
  • (C) docker commit
  • (D) docker send

A

Admin • 833.24K Points
Coach

Q. What does the 'docker exec' command do?

  • (A) Executes a command inside a running container
  • (B) Executes a new container
  • (C) Executes an image build
  • (D) Executes a Docker file

A

Admin • 833.24K Points
Coach

Q. What does the '--detach' or '-d' flag do when running 'docker run'?

  • (A) Runs the container in background mode
  • (B) Runs the container in interactive mode
  • (C) Assigns a random name to the container
  • (D) Forces the container to restart automatically

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