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命令创建卷。
这里是您应该知道的有关卷的详细信息,本地卷插件不支持指定位置
使用或支持指定位置的