diff options
author | William Yeh <william.pjyeh@gmail.com> | 2016-03-29 18:52:55 +0800 |
---|---|---|
committer | William Yeh <william.pjyeh@gmail.com> | 2016-03-29 18:52:55 +0800 |
commit | c71ff1bfb4fc8eef2b2f0ca2347de4b35e3a0197 (patch) | |
tree | bb19ba028676cd292e6f36da21cec7a0dfabfe24 /1.9-centos7-onbuild | |
parent | 14e54a03841a837231975247f70f063527a6f7b6 (diff) | |
parent | 58b1968eb7b2b163d840b7a6b6f347a0cae1e616 (diff) | |
download | docker-ansible-c71ff1bfb4fc8eef2b2f0ca2347de4b35e3a0197.tar.gz docker-ansible-c71ff1bfb4fc8eef2b2f0ca2347de4b35e3a0197.tar.zst docker-ansible-c71ff1bfb4fc8eef2b2f0ca2347de4b35e3a0197.zip |
Merge pull request #12 from William-Yeh/systemd
Add: systemd support in CentOS 7
Diffstat (limited to '1.9-centos7-onbuild')
-rw-r--r-- | 1.9-centos7-onbuild/Dockerfile | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/1.9-centos7-onbuild/Dockerfile b/1.9-centos7-onbuild/Dockerfile index e9054b3..7b8e028 100644 --- a/1.9-centos7-onbuild/Dockerfile +++ b/1.9-centos7-onbuild/Dockerfile | |||
@@ -17,7 +17,22 @@ FROM centos:centos7 | |||
17 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | 17 | MAINTAINER William Yeh <william.pjyeh@gmail.com> |
18 | 18 | ||
19 | 19 | ||
20 | RUN echo "===> Installing EPEL..." && \ | 20 | # enable systemd; |
21 | # @see https://hub.docker.com/_/centos/ | ||
22 | ENV container docker | ||
23 | |||
24 | RUN echo "===> Enabling systemd..." && \ | ||
25 | (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ | ||
26 | rm -f /lib/systemd/system/multi-user.target.wants/*; \ | ||
27 | rm -f /etc/systemd/system/*.wants/*; \ | ||
28 | rm -f /lib/systemd/system/local-fs.target.wants/*; \ | ||
29 | rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ | ||
30 | rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ | ||
31 | rm -f /lib/systemd/system/basic.target.wants/*; \ | ||
32 | rm -f /lib/systemd/system/anaconda.target.wants/* && \ | ||
33 | \ | ||
34 | \ | ||
35 | echo "===> Installing EPEL..." && \ | ||
21 | yum -y install epel-release && \ | 36 | yum -y install epel-release && \ |
22 | \ | 37 | \ |
23 | \ | 38 | \ |
@@ -48,6 +63,19 @@ RUN echo "===> Installing EPEL..." && \ | |||
48 | echo 'localhost' > /etc/ansible/hosts | 63 | echo 'localhost' > /etc/ansible/hosts |
49 | 64 | ||
50 | 65 | ||
66 | # | ||
67 | # [Quote] https://hub.docker.com/_/centos/ | ||
68 | # | ||
69 | # "In order to run a container with systemd, | ||
70 | # you will need to mount the cgroups volumes from the host. | ||
71 | # [...] | ||
72 | # There have been reports that if you're using an Ubuntu host, | ||
73 | # you will need to add -v /tmp/$(mktemp -d):/run | ||
74 | # in addition to the cgroups mount." | ||
75 | # | ||
76 | VOLUME [ "/sys/fs/cgroup", "/run" ] | ||
77 | |||
78 | |||
51 | COPY ansible-playbook-wrapper /usr/local/bin/ | 79 | COPY ansible-playbook-wrapper /usr/local/bin/ |
52 | 80 | ||
53 | ONBUILD WORKDIR /tmp | 81 | ONBUILD WORKDIR /tmp |