Docker MCQs with answers Page - 15

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

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

  • (A) To download an image from a Docker registry
  • (B) To create a new image from a Dockerfile
  • (C) To push an image to a Docker registry
  • (D) To remove an image from the local machine

A

Admin • 832.01K Points
Coach

Q. Which Docker command would you use to enter an interactive shell inside a running container?

  • (A) docker exec -it
  • (B) docker run -it
  • (C) docker enter -it
  • (D) docker start -i

A

Admin • 832.01K Points
Coach

Q. What is Docker Swarm?

  • (A) A system for managing and orchestrating multi-container applications
  • (B) A networking tool for containers
  • (C) A Docker container image
  • (D) A tool for building Docker images

A

Admin • 832.01K Points
Coach

Q. How do you forcefully remove a running container?

  • (A) docker rm -f
  • (B) docker stop -f
  • (C) docker remove -f
  • (D) docker kill

A

Admin • 832.01K Points
Coach

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

  • (A) To publish a container's port to the host
  • (B) To specify which ports the container will listen on
  • (C) To open a firewall port
  • (D) To map a container port to a host port

A

Admin • 832.01K Points
Coach

Q. Which command is used to view logs of a Docker container?

  • (A) docker logs
  • (B) docker view
  • (C) docker history
  • (D) docker inspect

A

Admin • 832.01K Points
Coach

Q. What is the purpose of Docker volumes?

  • (A) To store Docker images
  • (B) To persist data generated by Docker containers
  • (C) To manage Docker networks
  • (D) To monitor Docker containers

A

Admin • 832.01K Points
Coach

Q. Which command is used to stop a running Docker container?

  • (A) docker halt
  • (B) docker stop
  • (C) docker kill
  • (D) docker pause

A

Admin • 832.01K Points
Coach

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

  • (A) To define the default command for the container
  • (B) To specify environment variables
  • (C) To set the working directory
  • (D) To expose network ports

A

Admin • 832.01K Points
Coach

Q. Which command is used to remove all stopped containers?

  • (A) docker rm -f
  • (B) docker prune
  • (C) docker clean
  • (D) docker rm $(docker ps -a -q)

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