Q. Which of the following is the default storage driver for Docker?

  • (A) aufs
  • (B) overlay2
  • (C) devicemapper
  • (D) btrfs
πŸ’¬ Discuss
βœ… Correct Answer: (B) overlay2
Explanation: The default storage driver for Docker is 'overlay2'.

Q. How do you list all Docker images available on your local machine?

  • (A) docker images
  • (B) docker list images
  • (C) docker image list
  • (D) docker show images
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker images
Explanation: The 'docker images' command lists all Docker images available on your local machine.

Q. Which command removes a Docker volume?

  • (A) docker volume rm
  • (B) docker volume delete
  • (C) docker volume remove
  • (D) docker rm volume
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker volume rm
Explanation: The 'docker volume rm' command is used to remove a Docker volume.

Q. Which of the following is a valid Docker network driver?

  • (A) bridge
  • (B) host
  • (C) overlay
  • (D) all of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) all of the above
Explanation: Docker supports several network drivers, including 'bridge', 'host', and 'overlay'.

Q. What does the '--rm' flag do when running a Docker container?

  • (A) Removes the container when it stops
  • (B) Runs the container in detached mode
  • (C) Rebuilds the image every time
  • (D) Maps the container port to a host port
πŸ’¬ Discuss
βœ… Correct Answer: (A) Removes the container when it stops
Explanation: The '--rm' flag removes the container automatically once it stops.

Q. Which of the following commands is used to start an existing Docker container?

  • (A) docker start
  • (B) docker restart
  • (C) docker run
  • (D) docker exec
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker start
Explanation: The 'docker start' command is used to start an existing Docker container.

Q. What does the 'docker ps' command display?

  • (A) The list of all Docker containers
  • (B) The list of running Docker containers
  • (C) The list of all Docker images
  • (D) The list of Docker volumes
πŸ’¬ Discuss
βœ… Correct Answer: (B) The list of running Docker containers
Explanation: The 'docker ps' command displays a list of all running Docker containers.

Q. Which command is used to remove a Docker image?

  • (A) docker rmi
  • (B) docker rm
  • (C) docker delete
  • (D) docker remove
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker rmi
Explanation: The 'docker rmi' command is used to remove a Docker image from the local machine.

Q. Which of the following is a valid Docker command to list running containers?

  • (A) docker list
  • (B) docker ps
  • (C) docker status
  • (D) docker containers
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker ps
Explanation: The 'docker ps' command lists all running Docker containers.

Q. What is the purpose of the '--name' flag in 'docker run'?

  • (A) To assign a specific name to a container
  • (B) To specify the image name
  • (C) To specify the network
  • (D) To map ports between host and container
πŸ’¬ Discuss
βœ… Correct Answer: (A) To assign a specific name to a container
Explanation: The '--name' flag is used to assign a specific name to a container during its creation.