我是靠谱客的博主 靓丽硬币,这篇文章主要介绍【原创】扯淡的Centos systemd与Docker冲突问题,现在分享给大家,希望可以做个参考。

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

首先欣赏一下Red Hat与Docker团队间的撕逼,http://www.open-open.com/news/view/117a7d2 从这个帖子看出来Centos7.1.1053版本的docker镜像是木有systemd的,so,在网上找到另一个帖子,http://www.tuicool.com/articles/6RRvQbi ,参考其给出的办法。

1. docker pull centos:7.1.1053 拉取一个7.1.1053版本的docker镜像

2. 自己写一个Dockerfile

# 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. 执行下面的命令做版本

docker build --rm -t centos7.1-systemd .

4. docker run

 

转载于:https://my.oschina.net/u/2601623/blog/676235

最后

以上就是靓丽硬币最近收集整理的关于【原创】扯淡的Centos systemd与Docker冲突问题的全部内容,更多相关【原创】扯淡的Centos内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(115)

评论列表共有 0 条评论

立即
投稿
返回
顶部