arrow_back
Back

Docker volume commands: create, list, and remove

Andrew Dorokhov Andrew Dorokhov schedule 1 min read
menu_book Table of Contents

docker volume create

Create a named volume.

docker volume create <NAME>

docker volume ls

List all volumes on the host.

docker volume ls

docker volume inspect

Display detailed volume information.

docker volume inspect <NAME>

docker volume rm

Delete a volume.

docker volume rm <NAME>

docker volume prune

Remove all unused volumes.

docker volume prune

When a volume is mounted to a directory that already contains files, those files are copied into the volume on first mount. Use -v with docker container rm or docker-compose rm -v to remove volumes associated with containers.

code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

Docker Swarm: clustering, services, and tasks

arrow_forward