2

我在 Windows 7 上的 docker 配置有问题。我正在使用 docker 工具箱。

以前我的配置运行良好,但现在它会导致错误。

DOCKER> I/O Error [Unable to start container id [7b5a4bd7ccfd] : OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \"rootfs_linux.go:58: mounting \\\"/c/Users/myProject/zip/src/elastic/elasticsearch.yml\\\" to rootfs \\\"/mnt/sda1/var/lib/docker/overlay2/f2f7c25fc05de0ec45cef945b0917beefe26bd1d0a31546378c2ffabfb905ccb/merged\\\" at \\\"/mnt/sda1/var/lib/docker/overlay2/f2f7c25fc05de0ec45cef945b0917beefe26bd1d0a31546378c2ffabfb905ccb/merged/usr/share/elasticsearch/config/elasticsearch.yml\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type (Bad Request: 400)]

我调查了问题,发现 docker mount elasticsearch.yml 文件作为文件夹,但在主机中它作为文件存在。有谁知道怎么可能?

<volumes>
  <bind>
<volume>${basedir}/src/elastic/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml</volume>
  </bind>
</volumes>

我希望 docker 将该文件作为文件找到。

非常感谢

4

2 回答 2

1

根据您在 Windows 上使用 docker 工具箱的标签。在这种情况下安装卷有点不同,需要更多的努力。

我建议您阅读这篇文章,您应该在其中找到问题的答案: https ://medium.com/@Charles_Stover/fixing-volumes-in-docker-toolbox-4ad5ace0e572

另外,请确保您的环境变量 base_dir 设置正确。

祝你好运

于 2019-08-12T13:17:00.603 回答
0

问题出在我的 VirtualBox 中。我已经更新了它,一切都按预期工作。

感谢每一个

于 2019-08-12T15:40:01.207 回答