我在 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 将该文件作为文件找到。
非常感谢