Posted at

Centos7のdocker imageでsystemdが使えるものを調査した

More than 3 years have passed since last update.


About

centos7のdocker imageにはfakesystemdが導入されているという問題があり使用を控えていましたが、風の噂でsystemdが使えるようになったので調査しました。


centos:latest& centos:7 & centos:centos7(7322fbe74aa5)


  • systemdがインストールされている

[root@f9681438b272 /]# cat etc/redhat-release

CentOS Linux release 7.1.1503 (Core)
[root@f9681438b272 /]# cat /etc/centos-release
CentOS Linux release 7.1.1503 (Core)
[root@f9681438b272 /]# which systemctl
/usr/bin/systemctl
[root@f9681438b272 /]# yum list | grep systemd
systemd-container.x86_64 208.20-6.el7.centos @systemdcontainer
systemd-container-libs.x86_64 208.20-6.el7.centos @systemdcontainer
golang-github-coreos-go-systemd-devel.noarch
systemd.x86_64 208-20.el7_1.5 updates
systemd-devel.i686 208-20.el7_1.5 updates
systemd-devel.x86_64 208-20.el7_1.5 updates
systemd-journal-gateway.x86_64 208-20.el7_1.5 updates
systemd-libs.i686 208-20.el7_1.5 updates
systemd-libs.x86_64 208-20.el7_1.5 updates
systemd-python.x86_64 208-20.el7_1.5 updates
systemd-sysv.x86_64 208-20.el7_1.5 updates


centos:7.0.1406 & centos:7.0.1406(feb2761601e7)


  • systemdがインストールされていない(fakesystemd)

[root@842b3d42833f /]# cat /etc/redhat-release

CentOS Linux release 7.0.1406 (Core)
[root@842b3d42833f /]# cat /etc/centos-release
CentOS Linux release 7.0.1406 (Core)
[root@842b3d42833f /]# which systemctl
/usr/bin/which: no systemctl in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
[root@842b3d42833f /]# yum list | grep systemd
fakesystemd.noarch 1-17.el7.centos @fakesystemd/$releasever
systemd-libs.x86_64 208-11.el7 @CentOS/$releasever
golang-github-coreos-go-systemd-devel.noarch
systemd.x86_64 208-20.el7_1.5 updates
systemd-devel.i686 208-20.el7_1.5 updates
systemd-devel.x86_64 208-20.el7_1.5 updates
systemd-journal-gateway.x86_64 208-20.el7_1.5 updates
systemd-libs.i686 208-20.el7_1.5 updates
systemd-libs.x86_64 208-20.el7_1.5 updates
systemd-python.x86_64 208-20.el7_1.5 updates
systemd-sysv.x86_64 208-20.el7_1.5 updates


centos:7.1.1503 & centos:centos7.1.1503


  • systemdがインストールされていない(fakesystemd)

[root@7cd70b31a95f /]# cat /etc/redhat-release

Derived from Red Hat Enterprise Linux 7.1 (Source)
[root@7cd70b31a95f /]# cat /etc/centos-release
CentOS Linux release 7.1.1503 (Core)
[root@7cd70b31a95f /]# which systemctl
/usr/bin/which: no systemctl in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
[root@7cd70b31a95f /]# which systemctl
/usr/bin/which: no systemctl in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
[root@7cd70b31a95f /]# which systemctl
/usr/bin/which: no systemctl in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
[root@7cd70b31a95f /]# yum list | grep systemd
fakesystemd.noarch 1-17.el7.centos @fakesystemd/$releasever
systemd-libs.x86_64 208-20.el7 @CentOS/$releasever
golang-github-coreos-go-systemd-devel.noarch
systemd.x86_64 208-20.el7_1.5 updates
systemd-devel.i686 208-20.el7_1.5 updates
systemd-devel.x86_64 208-20.el7_1.5 updates
systemd-journal-gateway.x86_64 208-20.el7_1.5 updates
systemd-libs.i686 208-20.el7_1.5 updates
systemd-libs.x86_64 208-20.el7_1.5 updates
systemd-python.x86_64 208-20.el7_1.5 updates
systemd-sysv.x86_64 208-20.el7_1.5 updates


まとめ

dockerのimageは同じタグでも定期的に更新されているらしいので、ハッシュ値を見て判断した方がよさそうです。というかなぜfakesystemdは辞めたのか理由が知りたい。