【问题标题】:Docker is not recognizing a directory as directory in Arch LinuxDocker 没有将目录识别为 Arch Linux 中的目录
【发布时间】:2019-05-08 20:48:58
【问题描述】:

基本上,当我尝试创建容器时出现此错误:

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.

不知道为什么会这样。它在 Manjaro 上运行良好,但在 Arch Labs 上无法运行。

【问题讨论】:

  • 你能用你正在执行的 Dockerfile 和 docker run 命令更新你的问题吗?为了更好地了解您的项目。
  • 顺便说一句,好像是this link的复制品

标签: docker archlinux manjaro


【解决方案1】:

使用的图像需要一个位于 /etc/timezone 的目录,该目录未在 Arch Linux 上使用。

预期的/etc/timezone 内容示例:

Etc/UTC

只需从您的命令或 docker-compose 文件中删除该绑定挂载即可。您需要在容器中设置不同的时区,或者找到一种方法使/etc/timezone 文件与/etc/localtime 保持同步。

/etc/timezone 我猜是 Solaris 和 Debian 的东西。它期望时区成对

Europe/Zürich

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-18
    • 2018-03-08
    • 1970-01-01
    • 2019-03-22
    • 2021-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多