Docker Course
Docker
/
Beginner

Volume Management

Definition

The set of CLI commands (`docker volume ...`) used to create, inspect, list, and delete Docker Volumes.

Explain Like I'm New

Housekeeping for your external hard drives. Over time, you accumulate dozens of abandoned volumes taking up gigabytes of space, and you have to clean them out.

Real World Example

A server runs out of disk space. The admin runs `docker volume ls` and sees 50 old database volumes. They run `docker volume prune` to instantly delete all volumes not currently attached to a running container.

Common Use Cases

  • •Disk cleanup
  • •Storage auditing

Interview Questions

basic

  • What command deletes all unused, unattached Docker Volumes to free up disk space?

intermediate

  • Can you easily rename a Docker Volume using a built-in CLI command?

Flash Cards

Question

Which command?

Click to reveal answer
Answer

`docker volume prune`.

Question

Can you rename?

Click to reveal answer
Answer

No. Docker does not natively support renaming volumes. You must create a new volume with the desired name, manually copy the data over using a temporary container, and delete the old volume.