首先欣赏一下Red Hat与Docker团队间的撕逼,http://www.open-open.com/news/view/117a7d2 从这个帖子看出来Centos7.1.1053版本的docker镜像是木有systemd的,so,在网上找到另外一个帖子,http://www.tuicool.com/articles/6RRvQbi ,参考其给出的办法。docker
1. docker pull centos:7.1.1053 拉取一个7.1.1053版本的docker镜像centos
2. 本身写一个Dockerfilesocket
# cat Dockerfile FROM centos:7.1.1503 MAINTAINER "you" <your@email.here> ENV container docker RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i ==systemd-tmpfiles-setup.service ] || rm -f $i; done); \ rm -f /lib/systemd/system/multi-user.target.wants/*;\ rm -f /etc/systemd/system/*.wants/*;\ rm -f /lib/systemd/system/local-fs.target.wants/*; \ rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ rm -f /lib/systemd/system/basic.target.wants/*;\ rm -f /lib/systemd/system/anaconda.target.wants/*;
3. 执行下面的命令作版本ui
docker build --rm -t centos7.1-systemd .
4. docker runcentos7