我在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将elasticsearch.yml文件作为文件夹安装,但在主机中它作为文件存在。有谁知道怎么回事?
<volumes>
<bind>
<volume>${basedir}/src/elastic/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml</volume>
</bind>
</volumes>
我希望docker将该文件保存为文件。
非常感谢
最佳答案
根据标签,您在Windows上使用docker工具箱。在这种情况下挂载卷有些不同,需要更多的精力。
我建议您阅读本文,在此您可以找到问题的答案:
https://medium.com/@Charles_Stover/fixing-volumes-in-docker-toolbox-4ad5ace0e572
另外,请确保正确设置了环境变量base_dir。
祝好运
关于docker - 容器初始化导致\“rootfs_linux.go:58:挂载到rootfs引起的不是目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57461678/