Docker MCQs with answers Page - 22

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.27K Points
Coach

Q. What is the purpose of the 'docker-compose scale' command?

  • (A) To increase the number of replicas for a service
  • (B) To resize Docker images
  • (C) To resize Docker volumes
  • (D) To resize Docker networks

A

Admin • 832.27K Points
Coach

Q. Which command is used to remove all unused Docker images?

  • (A) docker image prune
  • (B) docker system prune
  • (C) docker clean images
  • (D) docker remove images

A

Admin • 832.27K Points
Coach

Q. What is the purpose of the 'docker-compose config' command?

  • (A) To validate and view the docker-compose.yml file
  • (B) To configure Docker networks
  • (C) To configure Docker volumes
  • (D) To configure Docker images

A

Admin • 832.27K Points
Coach

Q. Which command is used to attach a running container to a network?

  • (A) docker network connect
  • (B) docker attach network
  • (C) docker connect network
  • (D) docker network attach

A

Admin • 832.27K Points
Coach

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

  • (A) To pull images for services defined in a docker-compose.yml file
  • (B) To push images to Docker Hub
  • (C) To build Docker images
  • (D) To stop running containers

A

Admin • 832.27K Points
Coach

Q. Which command is used to detach a container from a network?

  • (A) docker network disconnect
  • (B) docker detach network
  • (C) docker disconnect network
  • (D) docker network detach

A

Admin • 832.27K Points
Coach

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

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

A

Admin • 832.27K Points
Coach

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

  • (A) docker info
  • (B) docker system info
  • (C) docker inspect
  • (D) docker version

A

Admin • 832.27K Points
Coach

Q. What is the purpose of the 'docker-compose pause' command?

  • (A) To pause all services defined in a docker-compose.yml file
  • (B) To stop all services
  • (C) To delete all services
  • (D) To restart all services

A

Admin • 832.27K Points
Coach

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

  • (A) docker system prune
  • (B) docker container prune
  • (C) docker network prune
  • (D) docker volume prune