nerdexam
LPI

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…

Containerization

Question

Which of the following commands deletes all volumes which are not associated with a container?

Options

  • Adocker volume cleanup
  • Bdocker volume orphan -d
  • Cdocker volume prune
  • Ddocker volume vacuum
  • Edocker volume garbage-collect

How the community answered

(28 responses)
  • A
    4% (1)
  • B
    14% (4)
  • C
    71% (20)
  • D
    7% (2)
  • E
    4% (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

#docker volume#volume pruning#resource cleanup

Community Discussion

No community discussion yet for this question.

Full 305-300 Practice