Containers, Dicas, Linux

Installing the OpenJDK 7 in a RHEL 7 Docker Image: systemd dep issue

Hello guys!

redhat-docker

Maybe you are thinking… WTF! Why have this guy written this post in English?!

Well,
I think this is my first blog post in this blog written in en_US. The motivation is simple. The subject (Docker and all the related things around it) is attracting almost all the attention of IT at this moment. So the basic idea is to help more people that might face the same issue described in this post.

So, please ignore any language/typo mistake.

😉

Ok!

For those trying to build a RHEL 7 Docker Base Image with Java 7 support (OpenJDK 7 packages), the openjdk pkgs depends on systemd. When you try to install the openjdk via yum you may see the following error:

bash-4.2# yum install java-1.7.0-openjdk.x86_64 java-1.7.0-openjdk-devel.x86_64
Resolving Dependencies
--> Running transaction check
---> Package java-1.7.0-openjdk.x86_64 1:1.7.0.71-2.5.3.1.el7_0 will be installed
...
Dependencies Resolved
==================================================================================================================================================
 Package Arch Version Repository Size
==================================================================================================================================================
Installing:
 java-1.7.0-openjdk x86_64 1:1.7.0.71-2.5.3.1.el7_0 rhel-7-server-rpms 196 k
 java-1.7.0-openjdk-devel x86_64 1:1.7.0.71-2.5.3.1.el7_0 rhel-7-server-rpms 9.1 M
Installing for dependencies:
...
systemd x86_64 208-11.el7_0.5 rhel-7-server-rpms 2.6 M
 systemd-sysv x86_64 208-11.el7_0.5 rhel-7-server-rpms 36 k
 sysvinit-tools x86_64 2.88-14.dsf.el7 rhel-7-server-rpms 63 k
...
Transaction Summary
==================================================================================================================================================
Install 2 Packages (+86 Dependent packages)
'Transaction check error:
file /usr/lib/rpm/macros.d/macros.systemd from install of systemd-208-11.el7_0.5.x86_64 conflicts with file from package fakesystemd-1-14.el7.x86_64'

The rhel7 official base image includes a fakesystemd (from @koji-override-0/7.0 repo) instead of full systemd. I’m not sure if this fafesystemd pkg is shipped with rhel 7 docker base image (I have to check to confirm). I saw some blogs posts saying it is used to avoid a number of bad implications with running full systemd on Docker Containers. I thik it come as a dependence with the openssh-server pkg I’ve installed before. This fakesystemd provides only some fake files to satisfy some other pkgs requirements that depends on systemd service:

bash-4.2# rpm -ql fakesystemd-1-14.el7.x86_64
/etc/binfmt.d
/etc/modules-load.d
/etc/sysctl.d
/etc/systemd
/etc/systemd/system
/etc/systemd/user
/etc/tmpfiles.d
/etc/udev
/etc/udev/rules.d
/usr/lib/binfmt.d
/usr/lib/modules-load.d
/usr/lib/rpm/macros.d/macros.systemd
/usr/lib/sysctl.d
/usr/lib/systemd
/usr/lib/systemd/catalog
/usr/lib/systemd/ntp-units.d
/usr/lib/systemd/system-generators
/usr/lib/systemd/system-preset
/usr/lib/systemd/system-shutdown
/usr/lib/systemd/system-sleep
/usr/lib/systemd/user-generators
/usr/lib/systemd/user-preset
/usr/lib/tmpfiles.d
/usr/share/pkgconfig
/usr/share/systemd
/var/lib/systemd
/var/lib/systemd/catalog

The workaround I’ve found for now is to remove the fakesystemd in order to be able to install the openjdk packages.

bash-4.2# yum remove fakesystemd-1-14.el7.x86_64

As I mentioned before to avoid the issues with the full systemd inside Docker containers I followed this approach: http://developerblog.redhat.com/2014/05/05/running-systemd-within-docker-container/

Well, I hope this could help you.

Anúncios

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s