I'm trying to update a Docker image based on the official CentOS7 image. It is used as a builder for Node.js projects.
I need to add the systemd-devel
package for compiling some dependencies, but this fails with the following error:
fakesystemd-1-17.el7.centos.noarch has installed conflicts systemd: fakesystemd-1-17.el7.centos.noarch
Thanks
fakesystemd
is a special package in the CentOS Docker image that satisfies the dependency to Systemd without actually installing Systemd (after all, you don't usually need an init system within a container). yum info fakesystemd
tells a bit more:
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
You need to swap the fakesystemd
package with the "real" systemd
package, and can then also install systemd-devel
:
RUN yum swap -y fakesystemd systemd && \
yum install -y systemd-devel
来源:https://stackoverflow.com/questions/36630718/docker-as-a-builder-cant-install-systemd-header-files