305-300 · Question #104
Which of the following commands deletes all volumes which are not associated with a container?
The correct answer is C. docker volume prune. The command that deletes all volumes which are not associated with a container is docker volume prune. This command removes all unused local volumes, which are those that are not that are not given a specific name when they are created. To remove both unused anonymous and named…
Question
Options
- Adocker volume cleanup
- Bdocker volume orphan -d
- Cdocker volume prune
- Ddocker volume vacuum
- Edocker volume garbage-collect
How the community answered
(28 responses)- A4% (1)
- B14% (4)
- C71% (20)
- D7% (2)
- E4% (1)
Explanation
The command that deletes all volumes which are not associated with a container is docker volume prune. This command removes all unused local volumes, which are those that are not that are not given a specific name when they are created. To remove both unused anonymous and named volumes, the -- all or -a flag can be added to the command. The command will prompt for confirmation before deleting the volumes, unless the --force or -f flag is used to bypass the prompt. The command will also show the total reclaimed space after deleting the volumes.
Topics
Community Discussion
No community discussion yet for this question.