| by Arround The Web | No comments

How to Create, List, and Remove Docker Volume?

Docker is a containerization solution that provides a user-friendly interface for building, sharing, and executing applications. Docker volume is a mechanism for storing data utilized by Docker containers. It provides a way to easily move data between different environments. Moreover, users are allowed to create, list, and remove Docker volumes efficiently.

This article will demonstrate:

How to Create a Docker Volume?

To create a Docker volume, execute the “docker volume create <volume-name>” command in the Windows PowerShell:

docker volume create test

Here, we have created a Docker volume named “test”:

How to List Docker Volumes?

Utilize the below-listed command to list all the Docker volumes:

docker volume list

In the below screenshot, three Docker volumes can be seen:

Moreover, the “ls” option can also be used with the “docker volume” command to display all volumes:

docker volume ls

How to Remove Docker Volume?

To remove the specific Docker volume, run the “docker volume rm” command and specify the particular volume name that needs to be deleted:

docker volume rm Volume1

Here, we want to remove the “Volume1” Docker volume:

To verify whether the desired volume has been deleted or not, execute the following command:

docker volume list

The below output indicates that the “Volume1” Docker volume has been deleted:

That was all about creating, listing, and removing Docker volume.

Conclusion

To create a Docker volume, utilize the “docker volume create <volume-name>” command. To list Docker volumes, run the “docker volume list” or “docker volume ls” command and to remove Docker volume, the “docker volume rm <volume-name>” command is used. This article demonstrated the methods for creating, listing, and removing Docker volumes.

Share Button

Source: linuxhint.com

Leave a Reply