Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker卷在Docker“internal”目录外创建_Docker_Ubuntu 16.04_Docker Volume - Fatal编程技术网

Docker卷在Docker“internal”目录外创建

Docker卷在Docker“internal”目录外创建,docker,ubuntu-16.04,docker-volume,Docker,Ubuntu 16.04,Docker Volume,我正在尝试指定创建卷的位置 我正在使用: # The following doesn't work, it will still bind to docker internal directory docker volume create \ --driver local \ --opt device=/var/foo/bar/ \ --name postgres_volume1 我的环境: Linux版本4.4.0-62-genericbuildd@lcy01-30 g

我正在尝试指定创建卷的位置

我正在使用:

# The following doesn't work, it will still bind to docker internal directory 
docker volume create \ 
   --driver local \
   --opt device=/var/foo/bar/ \
   --name postgres_volume1
我的环境: Linux版本4.4.0-62-genericbuildd@lcy01-30 gcc版本5.4.0 20160609 Ubuntu 5.4.0-6ubuntu1~16.04.4 83 Ubuntu SMP星期三2017年1月18日14:10:15 UTC


Docker版本17.09.0-ce。

您正在创建卷。因此,它将绑定到docker内部目录。如果运行该命令:

docker volume inspect <volume-name>
它将显示实际安装点。如果要更改卷的位置,不必使用create命令创建卷。 这里是您应该知道的有关卷的详细信息,本地卷插件不支持指定位置

使用或支持指定位置的