我需要为Docker 创建一个持久卷。该卷必须命名extra-addons
并位于中/mnt/
。
我运行以下命令:
sudo docker volume create /mnt/extra-addons
我收到此错误消息:
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
请注意,当我简单地运行:时sudo docker volume create extra-addons
,我没有遇到这个问题,但是当我使用来检查有问题的卷时sudo docker inspect extra-addons
,我看到它位于我不想要的地方:
[
{
"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"
}
]
我的意思是我希望看到这样的体积: /mnt/extra-addons
任何想法?