Docker MCQs with answers Page - 10

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

Q. What is the purpose of the 'docker exec' command?

  • (A) To execute a command inside a running container
  • (B) To create a new Docker container
  • (C) To remove a container
  • (D) To build a Docker image

A

Admin • 831.35K Points
Coach

Q. What is the difference between 'docker stop' and 'docker kill'?

  • (A) docker stop terminates containers immediately, docker kill gracefully stops them
  • (B) docker stop sends a SIGTERM signal, docker kill sends SIGKILL
  • (C) docker stop is for containers, docker kill is for images
  • (D) docker stop is a safer method, docker kill is faster

A

Admin • 831.35K Points
Coach

Q. Which of the following is a valid option for the 'docker run' command?

  • (A) -name
  • (B) -d
  • (C) --execute
  • (D) --detach

A

Admin • 831.35K Points
Coach

Q. What is the default network driver used by Docker?

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

A

Admin • 831.35K Points
Coach

Q. Which of the following commands creates a Docker container from an image?

  • (A) docker run
  • (B) docker create
  • (C) docker build
  • (D) docker start

A

Admin • 831.35K Points
Coach

Q. What command would you use to remove a Docker image?

  • (A) docker rm image_name
  • (B) docker rmi image_name
  • (C) docker image rm image_name
  • (D) docker remove image_name

A

Admin • 831.35K Points
Coach

Q. Which command is used to build a Docker image from a Dockerfile?

  • (A) docker create
  • (B) docker build
  • (C) docker run
  • (D) docker compose

A

Admin • 831.35K Points
Coach

Q. What is the default network driver used by Docker?

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

A

Admin • 831.35K Points
Coach

Q. Which command is used to list all running Docker containers?

  • (A) docker ps
  • (B) docker ls
  • (C) docker list
  • (D) docker containers

A

Admin • 831.35K Points
Coach

Q. What is the purpose of a Dockerfile?

  • (A) To define the runtime environment for a container
  • (B) To manage Docker volumes
  • (C) To configure Docker networks
  • (D) To monitor Docker containers