Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.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 run命令中装载卷的子卷吗_Docker_Docker Compose - Fatal编程技术网

我可以在docker run命令中装载卷的子卷吗

我可以在docker run命令中装载卷的子卷吗,docker,docker-compose,Docker,Docker Compose,在使用docker时,我试图避免使用缓慢的osxfs。所以我正在运行docker sync卷容器 我只想将此卷的子目录装入另一个容器 当前示例错误: docker: Error response from daemon: create docker-sync/www/marcopolo.front: "docker-sync/www/marcopolo.front" includes invalid characters for a local volume name, only "[a-zA

在使用docker时,我试图避免使用缓慢的osxfs。所以我正在运行docker sync卷容器

我只想将此卷的子目录装入另一个容器

当前示例错误:

docker: Error response from daemon: create docker-sync/www/marcopolo.front: "docker-sync/www/marcopolo.front" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed.
See 'docker run --help'.

如您所见,docker目前不提供仅从命名卷内部装载子目录的方法。您必须装载到整个卷,然后选择您的特定文件,或者您可以装载到单独位置的卷,并在映像中包含指向特定子目录的符号链接。

子目录完全有效。只需确保该文件夹存在。错误指向奇怪的字符。据我所知,您使用的是有效字符:字母、句号和连字符。您如何运行此命令?也许你的别名有字符集问题?请尝试从您共享的“alias”块外部运行同一行。@mayid“[a-zA-Z0-9][a-zA-Z0-9.-]”对于子目录,我需要
/
,这是不允许的。这是因为我刚才说的是文件夹名称,/是分隔符。请参阅:其中显示“将主机目录装载为数据卷”;他们解释了这一点,并使用了细分曲面。这很自然,因为您可能希望将卷放在pc中的任何位置。
docker sync
是当前目录中的文件夹名称,还是
docker volume ls
中的卷名称?@BMitch它是卷。我认为这在
中很清楚,所以我正在运行docker sync volume container