Docker MCQs with answers Page - 16

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. What is the purpose of the 'docker inspect' command?

  • (A) To view logs of a container
  • (B) To display detailed information about a Docker object
  • (C) To list running containers
  • (D) To build a Docker image

A

Admin • 833.24K Points
Coach

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

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

A

Admin • 833.24K Points
Coach

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

  • (A) To execute a command in a running container
  • (B) To start a new container
  • (C) To build a Docker image
  • (D) To stop a running container

A

Admin • 833.24K Points
Coach

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

  • (A) To save changes made to a container as a new image
  • (B) To push an image to Docker Hub
  • (C) To create a new container
  • (D) To delete a Docker image

A

Admin • 833.24K Points
Coach

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

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

A

Admin • 833.24K Points
Coach

Q. What is a Docker 'service' in the context of Docker Swarm?

  • (A) A single container running on the Swarm cluster
  • (B) A group of containers managed by Docker Swarm
  • (C) A networking resource for containers
  • (D) A task for orchestrating containers

A

Admin • 833.24K Points
Coach

Q. Which of the following is a valid Docker command to view the logs of a container?

  • (A) docker logs container_name
  • (B) docker view container_logs
  • (C) docker status container_name
  • (D) docker exec container_name logs

A

Admin • 833.24K Points
Coach

Q. What is Docker Hub?

  • (A) A tool for building Docker images
  • (B) A public repository for Docker images
  • (C) A network service for containers
  • (D) A tool for orchestrating Docker containers

A

Admin • 833.24K Points
Coach

Q. What does the 'docker-compose up' command do?

  • (A) Starts the services defined in a docker-compose.yml file
  • (B) Stops the services in a docker-compose.yml file
  • (C) Builds the Docker image from the Dockerfile
  • (D) Uploads a Docker image to Docker Hub

A

Admin • 833.24K Points
Coach

Q. What is the purpose of Docker's multi-stage builds?

  • (A) To build images with multiple base images to reduce the image size
  • (B) To add multiple layers to a Docker image
  • (C) To automate the deployment of containers
  • (D) To run containers on multiple machines

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