FreeKB - docker volume command (create a volume)
Docker - docker volume command (create a volume)

This assumes you have installed Docker on Linux and Docker is running. The following command creates a docker volume named foo-volume.

docker network create foo-volume

 

The docker volume ls command can be used to display the docker volumes.

docker volume ls

 

Which should return something like this.

DRIVER        VOLUME NAME
local         foo-volume

 

The docker volume inspect command can be used to display the configuration of the volume.

docker volume inspect foo-volume

 

Which should return JSON something like this. Notice in this example that mountpoint is /var/lib/docker/volumes/foo-volume/_data. This correlates to a directory on the host operating system.

[
 {
  "Driver":"local",
  "Labels":{},
  "Mountpoint":"/var/lib/docker/volumes/foo-volume/_data",
  "Name":"foo-volume",
  "Options":{},
  "Scope":"local"
 }
]

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter d4120 in the box below so that we can be sure you are a human.




Comments