Interacting With Docker Volumes
Each volume’s name and the storage driver that supports it will be shown. Use docker volume inspect to obtain more in-depth details about a particular volume instead:
Inspecting Volumes
To inspect volumes in Docker, you can use the docker volume inspect
command followed by the name or ID of the volume you want to inspect. For example:
docker volume inspect my_vol
Removing Volumes
To remove volumes in Docker, you can use the docker volume rm
command followed by the name or ID of the volume you want to remove. For example:
docker volume rm my_vol
Pruning Volumes
To prune volumes in Docker, you can use the docker volume prune
command. This command removes all volumes not used by at least one container. Here’s how you can use it:
docker volume prune
What Is Docker Volume?
Docker containers enable apps to execute in an isolated environment. All modifications made inside the container are lost by default when it ends. Docker volumes and bind mounts can be useful for storing data in between runs. One way to store data outside of containers is with volumes. All volumes are kept in a specific directory on your host, typically /var/lib/docker/volumes for Linux systems, and are controlled by Docker.
Contact Us