Member-only story

Docker Volume Command

Meghasharmaa
8 min readMar 8, 2024

The docker volume command is used to manage Docker volumes. It provides various subcommands to create, inspect, list, remove, and prune volumes. Here's an overview of the docker volume command and its subcommands:

👉Create a Volume:

Command: docker volume create[VOLUME_NAME]: Creates a new named volume with the specified name or lets Docker generate a unique name if not provided.

Example:

docker volume create my_volume

This command creates a Docker volume named my_volume on your Docker host. Once created, this volume can be used to persist data generated by containers or share data between containers.

👉 Inspect a Volume:

Command: docker volume inspect [VOLUME_NAME]: Displays detailed information about one or more volumes, including metadata and options.

Example:

docker volume inspect my_volume

This command inspects the volume named my_volume and provides detailed information about its configuration and properties. It returns a JSON-formatted output containing various details such as the volume's name, driver, mount point, labels, and other metadata.

For instance, if you have previously created the my_volume volume using the…

--

--

Meghasharmaa
Meghasharmaa

Written by Meghasharmaa

DevOps Architect | AWS | Docker | Kubernetes | Terraform | Google Cloud | Python

Responses (1)