docker中使用systemd
由于以下几个原因,docker的官方centos镜像中没有提供systemd服务: systemd requires theCAP_SYS_ADMINcapability. This means running docker with--privileged. Not good for a base image. systemd requires access to thecgroupsfilesystem. systemdhas a number of unit files that don’t matter in a container, and they cause errors if they’re not removed 但在可控环境下,我们还是希望使用systemd来管理我们的服务,如何开启systemd呢? 首先创建一个Dockerfile用来创建systemd的base image: FROM centos:latest MAINTAINER feisky RUN yum -y install systemd systemd-libs #RUN yum -y u...