I need to create a persistent volume for Docker. The volume must be named extra-addons
and located in /mnt/
.
I run this command:
sudo docker volume create /mnt/extra-addons
I got this error message:
Error response from daemon: create /mnt/extra-addons: "/mnt/extra-addons" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path
Note that when I simply run: sudo docker volume create extra-addons
, I do not face this problem but when I inspect the volume in question using sudo docker inspect extra-addons
, I see it is located in a place I do not want:
[
{
"CreatedAt": "2018-04-21T14:40:25+03:00",
"Driver": "local",
"Labels": {},
"Mountpoint": "/var/lib/docker/volumes/extra-addons/_data",
"Name": "extra-addons",
"Options": {},
"Scope": "local"
}
]
I mean I rather want to see the volume like this: /mnt/extra-addons
Any idea?