【问题标题】:docker build RUN error while loading shared libraries加载共享库时 docker build RUN 错误
【发布时间】:2020-02-04 18:54:15
【问题描述】:

我无法在我的 RHEL 服务器上运行简单的构建。

在运行docker build 时,我得到了

Step 2/2 : RUN echo "Hello there!"
 ---> Running in 0d0fd7f69a5f

/bin/sh: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
The command '/bin/sh -c echo "Hello there!"' returned a non-zero code: 127

Dockerfile:

FROM ubuntu:latest
RUN echo "Hello there!"

RHEL 7.7 - Linux 3.10.0-1062.9.1.el7.x86_64

Docker 版本 1.13.1,构建 4ef4b30/1.13.1

Dockerfile 很好——我可以在任何其他机器上构建映像,所以我想知道问题到底出在哪里。谢谢!

【问题讨论】:

  • echo "Hello world" 在 RHEL 终端上工作吗?
  • 你试过RUN sudo echo "Hello there!"吗?
  • 试试docker pull ubuntu;貌似你本地的ubuntu 图像被指向了别的东西。
  • echo "Hello world" 有效。 sudo 没有帮助。 docker pull ubuntuImage is up to date for docker.io/ubuntu:latest
  • 你能在你的主机上做这个检查吗? access.redhat.com/solutions/323023

标签: docker sh libc


【解决方案1】:

感谢大家的建议!

原来是 SELinux 问题。似乎 Docker 需要正确配置 SELinux 才能运行(在我的情况下,我选择使用 sudo setenforce 0 禁用 SELinux)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-11
    • 2015-06-28
    • 2011-05-29
    • 1970-01-01
    相关资源
    最近更新 更多