调查了在Centos7的docker镜像中可使用systemd的选项
关于
CentOS 7的Docker镜像存在着一个问题,即引入了fakesystemd,并因此而谨慎使用。但根据风言风语,听说现在可以使用systemd,所以我进行了调查。
- 更新のdocker hubはここ centos Repository | Docker Hub Registry – Repositories of Docker Images
centos:最新版本& 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是什么原因。