我試圖更新基於官方CentOS7映像的Docker鏡像。它用作Node.js項目的構建器。Docker作爲構建器,無法安裝systemd頭文件
我需要添加systemd-devel
包編譯一些依賴,但是這個失敗,出現以下錯誤:
fakesystemd-1-17.el7.centos.noarch has installed conflicts systemd: fakesystemd-1-17.el7.centos.noarch
感謝
我試圖更新基於官方CentOS7映像的Docker鏡像。它用作Node.js項目的構建器。Docker作爲構建器,無法安裝systemd頭文件
我需要添加systemd-devel
包編譯一些依賴,但是這個失敗,出現以下錯誤:
fakesystemd-1-17.el7.centos.noarch has installed conflicts systemd: fakesystemd-1-17.el7.centos.noarch
感謝
fakesystemd
是CentOS的碼頭工人形象,滿足在一個特殊的包在沒有實際安裝Systemd的情況下依賴於Systemd(畢竟,通常不需要容器內的init系統)。 yum info fakesystemd
告訴多一點:
Minimal docker-specific package to satisfy systemd
Provides:
without installing systemd in Docker images. It is intended strictly for use in Docker images/containers. It doesn't provide any functionality from systemd package - it only contains few important directories and files. fakesystemd is definitely not applicable for full bootable operation system!To install the real systemd in the image you need to run yum swap command in this form:
yum swap -- remove fakesystemd -- install systemd systemd-libs
您需要具有「真正的」 systemd
包交換fakesystemd
包,然後也可以安裝systemd-devel
:
RUN yum swap -y fakesystemd systemd && \
yum install -y systemd-devel
完美的作品,謝謝! –