简体   繁体   English

Docker 无法将目录识别为 Arch Linux 中的目录

[英]Docker is not recognizing a directory as directory in Arch Linux

Basically, I'm getting this error when I try to create my containers:基本上,当我尝试创建容器时出现此错误:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:337: starting container process caused "process_linux.go:403: container init caused \"rootfs_linux.go:58: mounting \\\"/etc/timezone\\\" to rootfs \\\"/var/lib/docker/overlay2/8864cea6615c7c165fce558661bf297c43ebf90f4de534ca9c9bd38f7af8b487/merged\\\" at \\\"/var/lib/docker/overlay2/8864cea6615c7c165fce558661bf297c43ebf90f4de534ca9c9bd38f7af8b487/merged/etc/timezone\\\" 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.

No Idea why this is happening.不知道为什么会这样。 It was working perfectly on Manjaro, but not working on Arch Labs.它在 Manjaro 上运行完美,但在 Arch Labs 上运行不佳。

The image used expects a directory at /etc/timezone that is not used on Arch Linux.所使用的图像需要一个位于/etc/timezone的目录,而 Arch Linux 上并未使用该目录。

Expected /etc/timezone contents example:预期的/etc/timezone内容示例:

Etc/UTC

Simply remove that bind mount from your command or docker-compose file.只需从您的命令或 docker-compose 文件中删除该绑定挂载。 You need to set the timezone at in the container differently or find a way to keep the /etc/timezone file in sync with /etc/localtime .您需要在容器中以不同方式设置时区,或者找到一种方法使/etc/timezone文件与/etc/localtime保持同步。

/etc/timezone is a Solaris and Debian thing, I guess.我猜/etc/timezone是 Solaris 和 Debian 的东西。 It expects the timezone as a pair它期望时区成对

Europe/Zürich

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM