Docker Volumes MCQs with answers Page - 3

You will find multiple-choice questions (MCQs) related to #Docker Volumes here. Go through these questions to prepare effectively for your upcoming exams and interviews.

To view the correct answer for any question, simply click the "Show Answer" button.

Have a question to share? Click on "Add Question" to contribute!

A

Admin • 828.43K Points
Coach

Q. Which of the following allows volume declaration in Docker Compose?

  • (A) services
  • (B) containers
  • (C) volumes
  • (D) envs

A

Admin • 828.43K Points
Coach

Q. What does `-v myvol:/data` mean?

  • (A) Bind mount /data to myvol
  • (B) Use myvol as a directory inside container at /data
  • (C) Create a bind mount from /data
  • (D) Copy myvol to container

A

Admin • 828.43K Points
Coach

Q. Which is true about volume data if a container is removed?

  • (A) Volume is also removed
  • (B) Volume data is wiped
  • (C) Volume stays intact
  • (D) Volume becomes read-only

A

Admin • 828.43K Points
Coach

Q. What is the main purpose of Docker volumes?

  • (A) To increase container speed
  • (B) To store persistent data outside of containers
  • (C) To compress image sizes
  • (D) To update Docker engine

A

Admin • 828.43K Points
Coach

Q. Which command creates a named volume in Docker?

  • (A) docker volume add mydata
  • (B) docker volume run mydata
  • (C) docker volume create mydata
  • (D) docker volume build mydata

A

Admin • 828.43K Points
Coach

Q. How do you list all volumes created in Docker?

  • (A) docker volumes
  • (B) docker volume ls
  • (C) docker list volumes
  • (D) docker volume show

A

Admin • 828.43K Points
Coach

Q. Which of the following is a valid way to mount a volume inside a container?

  • (A) docker run -v /app:/data nginx
  • (B) docker run nginx:/data /app
  • (C) docker mount /data:/app nginx
  • (D) docker start -mount /app:/data nginx

A

Admin • 828.43K Points
Coach

Q. What happens when you remove a container using a volume?

  • (A) The volume is automatically deleted
  • (B) Only the container is deleted, volume persists
  • (C) Both are deleted
  • (D) Nothing happens

A

Admin • 828.43K Points
Coach

Q. Which flag is used to mount volumes using long syntax in `docker run`?

  • (A) --add
  • (B) --mount
  • (C) --use
  • (D) --volume

A

Admin • 828.43K Points
Coach

Q. Which type of volume is managed by Docker and stored in the Docker directory?

  • (A) Host bind mount
  • (B) Named volume
  • (C) Anonymous volume
  • (D) Shared volume
What's Tag

As you may know, questions are organized under broad categories. Each category can include various types of questions. For example, the "History" category might contain questions about the Revolt of 1857, Shivaji Maharaj, Ancient History, Buddhism, and more.

To further refine this organization, we've introduced tags, which act as sub-categories to group questions more specifically.

Verified users can add tags to any question. If you have any suggestions regarding this system, we'd love to hear from you. Contact Us

Learn More