aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorWilliam Yeh <william.pjyeh@gmail.com>2016-03-29 18:25:25 +0800
committerWilliam Yeh <william.pjyeh@gmail.com>2016-03-29 18:25:25 +0800
commit58b1968eb7b2b163d840b7a6b6f347a0cae1e616 (patch)
treebb19ba028676cd292e6f36da21cec7a0dfabfe24
parent14e54a03841a837231975247f70f063527a6f7b6 (diff)
downloaddocker-ansible-58b1968eb7b2b163d840b7a6b6f347a0cae1e616.tar.gz
docker-ansible-58b1968eb7b2b163d840b7a6b6f347a0cae1e616.tar.zst
docker-ansible-58b1968eb7b2b163d840b7a6b6f347a0cae1e616.zip
Add: systemd support in CentOS 7
@see https://hub.docker.com/_/centos/ @see https://github.com/vlisivka/docker-centos7-systemd-unpriv
-rw-r--r--.travis.yml12
-rw-r--r--1.9-centos7-onbuild/Dockerfile30
-rw-r--r--1.9-centos7/Dockerfile30
-rw-r--r--centos7-onbuild/Dockerfile30
-rwxr-xr-xcentos7-onbuild/ansible-playbook-wrapper1
-rw-r--r--centos7/Dockerfile29
-rw-r--r--circle.yml12
-rw-r--r--master-centos7-onbuild/Dockerfile30
-rw-r--r--master-centos7/Dockerfile30
9 files changed, 185 insertions, 19 deletions
diff --git a/.travis.yml b/.travis.yml
index 9725e04..060b99c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -44,14 +44,14 @@ before_install:
44 - docker build -t ansible_master_precise master-ubuntu12.04 44 - docker build -t ansible_master_precise master-ubuntu12.04
45 - docker build -t ansible_master_jessie master-debian8 45 - docker build -t ansible_master_jessie master-debian8
46 - docker build -t ansible_master_wheezy master-debian7 46 - docker build -t ansible_master_wheezy master-debian7
47 #- docker build -t ansible_master_centos7 master-centos7 47 - docker build -t ansible_master_centos7 master-centos7
48 - docker build -t ansible_master_centos6 master-centos6 48 - docker build -t ansible_master_centos6 master-centos6
49 49
50 - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild 50 - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild
51 - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild 51 - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild
52 - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild 52 - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild
53 - docker build -t ansible_master_wheezy_onbuild master-debian7-onbuild 53 - docker build -t ansible_master_wheezy_onbuild master-debian7-onbuild
54 #- docker build -t ansible_master_centos7_onbuild master-centos7-onbuild 54 - docker build -t ansible_master_centos7_onbuild master-centos7-onbuild
55 - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild 55 - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild
56 56
57script: 57script:
@@ -91,13 +91,13 @@ script:
91 - docker run -i ansible_master_precise > result-master-ubuntu12.04 91 - docker run -i ansible_master_precise > result-master-ubuntu12.04
92 - docker run -i ansible_master_jessie > result-master-debian8 92 - docker run -i ansible_master_jessie > result-master-debian8
93 - docker run -i ansible_master_wheezy > result-master-debian7 93 - docker run -i ansible_master_wheezy > result-master-debian7
94 #- docker run -i ansible_master_centos7 > result-master-centos7 94 - docker run -i ansible_master_centos7 > result-master-centos7
95 - docker run -i ansible_master_centos6 > result-master-centos6 95 - docker run -i ansible_master_centos6 > result-master-centos6
96 - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild 96 - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild
97 - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild 97 - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild
98 - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild 98 - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild
99 - docker run -i ansible_master_wheezy_onbuild > result-master-debian7-onbuild 99 - docker run -i ansible_master_wheezy_onbuild > result-master-debian7-onbuild
100 #- docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild 100 - docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild
101 - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild 101 - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild
102 102
103 103
@@ -137,11 +137,11 @@ script:
137 - sh -c "[ -s result-master-ubuntu12.04 ]" 137 - sh -c "[ -s result-master-ubuntu12.04 ]"
138 - sh -c "[ -s result-master-debian8 ]" 138 - sh -c "[ -s result-master-debian8 ]"
139 - sh -c "[ -s result-master-debian7 ]" 139 - sh -c "[ -s result-master-debian7 ]"
140 #- sh -c "[ -s result-master-centos7 ]" 140 - sh -c "[ -s result-master-centos7 ]"
141 - sh -c "[ -s result-master-centos6 ]" 141 - sh -c "[ -s result-master-centos6 ]"
142 - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" 142 - sh -c "[ -s result-master-ubuntu14.04-onbuild ]"
143 - sh -c "[ -s result-master-ubuntu12.04-onbuild ]" 143 - sh -c "[ -s result-master-ubuntu12.04-onbuild ]"
144 - sh -c "[ -s result-master-debian8-onbuild ]" 144 - sh -c "[ -s result-master-debian8-onbuild ]"
145 - sh -c "[ -s result-master-debian7-onbuild ]" 145 - sh -c "[ -s result-master-debian7-onbuild ]"
146 #- sh -c "[ -s result-master-centos7-onbuild ]" 146 - sh -c "[ -s result-master-centos7-onbuild ]"
147 - sh -c "[ -s result-master-centos6-onbuild ]" 147 - sh -c "[ -s result-master-centos6-onbuild ]"
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
17MAINTAINER William Yeh <william.pjyeh@gmail.com> 17MAINTAINER William Yeh <william.pjyeh@gmail.com>
18 18
19 19
20RUN echo "===> Installing EPEL..." && \ 20# enable systemd;
21# @see https://hub.docker.com/_/centos/
22ENV container docker
23
24RUN 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#
76VOLUME [ "/sys/fs/cgroup", "/run" ]
77
78
51COPY ansible-playbook-wrapper /usr/local/bin/ 79COPY ansible-playbook-wrapper /usr/local/bin/
52 80
53ONBUILD WORKDIR /tmp 81ONBUILD WORKDIR /tmp
diff --git a/1.9-centos7/Dockerfile b/1.9-centos7/Dockerfile
index 681ac27..8d6da85 100644
--- a/1.9-centos7/Dockerfile
+++ b/1.9-centos7/Dockerfile
@@ -17,7 +17,22 @@ FROM centos:centos7
17MAINTAINER William Yeh <william.pjyeh@gmail.com> 17MAINTAINER William Yeh <william.pjyeh@gmail.com>
18 18
19 19
20RUN echo "===> Installing EPEL..." && \ 20# enable systemd;
21# @see https://hub.docker.com/_/centos/
22ENV container docker
23
24RUN 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,5 +63,18 @@ 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#
76VOLUME [ "/sys/fs/cgroup", "/run" ]
77
78
51# default command: display Ansible version 79# default command: display Ansible version
52CMD [ "ansible-playbook", "--version" ] 80CMD [ "ansible-playbook", "--version" ]
diff --git a/centos7-onbuild/Dockerfile b/centos7-onbuild/Dockerfile
index 7d6caf0..9274bee 100644
--- a/centos7-onbuild/Dockerfile
+++ b/centos7-onbuild/Dockerfile
@@ -17,7 +17,22 @@ FROM centos:centos7
17MAINTAINER William Yeh <william.pjyeh@gmail.com> 17MAINTAINER William Yeh <william.pjyeh@gmail.com>
18 18
19 19
20RUN echo "===> Installing EPEL..." && \ 20# enable systemd;
21# @see https://hub.docker.com/_/centos/
22ENV container docker
23
24RUN 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#
76VOLUME [ "/sys/fs/cgroup", "/run" ]
77
78
51COPY ansible-playbook-wrapper /usr/local/bin/ 79COPY ansible-playbook-wrapper /usr/local/bin/
52 80
53ONBUILD WORKDIR /tmp 81ONBUILD WORKDIR /tmp
diff --git a/centos7-onbuild/ansible-playbook-wrapper b/centos7-onbuild/ansible-playbook-wrapper
index 0ba45e6..002158d 100755
--- a/centos7-onbuild/ansible-playbook-wrapper
+++ b/centos7-onbuild/ansible-playbook-wrapper
@@ -13,7 +13,6 @@
13# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" 13# - INVENTORY: inventory filename; default = "/etc/ansible/hosts"
14# 14#
15 15
16
17# 16#
18# install Galaxy roles, if any 17# install Galaxy roles, if any
19# 18#
diff --git a/centos7/Dockerfile b/centos7/Dockerfile
index e6c9f9e..0f2112d 100644
--- a/centos7/Dockerfile
+++ b/centos7/Dockerfile
@@ -17,7 +17,22 @@ FROM centos:centos7
17MAINTAINER William Yeh <william.pjyeh@gmail.com> 17MAINTAINER William Yeh <william.pjyeh@gmail.com>
18 18
19 19
20RUN echo "===> Installing EPEL..." && \ 20# enable systemd;
21# @see https://hub.docker.com/_/centos/
22ENV container docker
23
24RUN 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 \
@@ -47,6 +62,18 @@ RUN echo "===> Installing EPEL..." && \
47 mkdir -p /etc/ansible && \ 62 mkdir -p /etc/ansible && \
48 echo 'localhost' > /etc/ansible/hosts 63 echo 'localhost' > /etc/ansible/hosts
49 64
65#
66# [Quote] https://hub.docker.com/_/centos/
67#
68# "In order to run a container with systemd,
69# you will need to mount the cgroups volumes from the host.
70# [...]
71# There have been reports that if you're using an Ubuntu host,
72# you will need to add -v /tmp/$(mktemp -d):/run
73# in addition to the cgroups mount."
74#
75VOLUME [ "/sys/fs/cgroup", "/run" ]
76
50 77
51# default command: display Ansible version 78# default command: display Ansible version
52CMD [ "ansible-playbook", "--version" ] 79CMD [ "ansible-playbook", "--version" ]
diff --git a/circle.yml b/circle.yml
index 0fe33ce..6867955 100644
--- a/circle.yml
+++ b/circle.yml
@@ -45,14 +45,14 @@ dependencies:
45 - docker build -t ansible_master_precise master-ubuntu12.04 45 - docker build -t ansible_master_precise master-ubuntu12.04
46 - docker build -t ansible_master_jessie master-debian8 46 - docker build -t ansible_master_jessie master-debian8
47 - docker build -t ansible_master_wheezy master-debian7 47 - docker build -t ansible_master_wheezy master-debian7
48 #- docker build -t ansible_master_centos7 master-centos7 48 - docker build -t ansible_master_centos7 master-centos7
49 - docker build -t ansible_master_centos6 master-centos6 49 - docker build -t ansible_master_centos6 master-centos6
50 50
51 - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild 51 - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild
52 - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild 52 - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild
53 - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild 53 - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild
54 - docker build -t ansible_master_wheezy_onbuild master-debian7-onbuild 54 - docker build -t ansible_master_wheezy_onbuild master-debian7-onbuild
55 #- docker build -t ansible_master_centos7_onbuild master-centos7-onbuild 55 - docker build -t ansible_master_centos7_onbuild master-centos7-onbuild
56 - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild 56 - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild
57 57
58test: 58test:
@@ -93,13 +93,13 @@ test:
93 - docker run -i ansible_master_precise > result-master-ubuntu12.04 93 - docker run -i ansible_master_precise > result-master-ubuntu12.04
94 - docker run -i ansible_master_jessie > result-master-debian8 94 - docker run -i ansible_master_jessie > result-master-debian8
95 - docker run -i ansible_master_wheezy > result-master-debian7 95 - docker run -i ansible_master_wheezy > result-master-debian7
96 #- docker run -i ansible_master_centos7 > result-master-centos7 96 - docker run -i ansible_master_centos7 > result-master-centos7
97 - docker run -i ansible_master_centos6 > result-master-centos6 97 - docker run -i ansible_master_centos6 > result-master-centos6
98 - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild 98 - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild
99 - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild 99 - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild
100 - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild 100 - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild
101 - docker run -i ansible_master_wheezy_onbuild > result-master-debian7-onbuild 101 - docker run -i ansible_master_wheezy_onbuild > result-master-debian7-onbuild
102 #- docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild 102 - docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild
103 - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild 103 - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild
104 104
105 105
@@ -139,11 +139,11 @@ test:
139 - sh -c "[ -s result-master-ubuntu12.04 ]" 139 - sh -c "[ -s result-master-ubuntu12.04 ]"
140 - sh -c "[ -s result-master-debian8 ]" 140 - sh -c "[ -s result-master-debian8 ]"
141 - sh -c "[ -s result-master-debian7 ]" 141 - sh -c "[ -s result-master-debian7 ]"
142 #- sh -c "[ -s result-master-centos7 ]" 142 - sh -c "[ -s result-master-centos7 ]"
143 - sh -c "[ -s result-master-centos6 ]" 143 - sh -c "[ -s result-master-centos6 ]"
144 - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" 144 - sh -c "[ -s result-master-ubuntu14.04-onbuild ]"
145 - sh -c "[ -s result-master-ubuntu12.04-onbuild ]" 145 - sh -c "[ -s result-master-ubuntu12.04-onbuild ]"
146 - sh -c "[ -s result-master-debian8-onbuild ]" 146 - sh -c "[ -s result-master-debian8-onbuild ]"
147 - sh -c "[ -s result-master-debian7-onbuild ]" 147 - sh -c "[ -s result-master-debian7-onbuild ]"
148 #- sh -c "[ -s result-master-centos7-onbuild ]" 148 - sh -c "[ -s result-master-centos7-onbuild ]"
149 - sh -c "[ -s result-master-centos6-onbuild ]" 149 - sh -c "[ -s result-master-centos6-onbuild ]"
diff --git a/master-centos7-onbuild/Dockerfile b/master-centos7-onbuild/Dockerfile
index 6087ad7..6d3fa21 100644
--- a/master-centos7-onbuild/Dockerfile
+++ b/master-centos7-onbuild/Dockerfile
@@ -17,7 +17,22 @@ FROM centos:centos7
17MAINTAINER William Yeh <william.pjyeh@gmail.com> 17MAINTAINER William Yeh <william.pjyeh@gmail.com>
18 18
19 19
20RUN echo "===> Installing EPEL..." && \ 20# enable systemd;
21# @see https://hub.docker.com/_/centos/
22ENV container docker
23
24RUN 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 yum -y update && \ 37 yum -y update && \
23 \ 38 \
@@ -69,6 +84,19 @@ RUN echo "===> Installing EPEL..." && \
69 echo 'localhost' > /etc/ansible/hosts 84 echo 'localhost' > /etc/ansible/hosts
70 85
71 86
87#
88# [Quote] https://hub.docker.com/_/centos/
89#
90# "In order to run a container with systemd,
91# you will need to mount the cgroups volumes from the host.
92# [...]
93# There have been reports that if you're using an Ubuntu host,
94# you will need to add -v /tmp/$(mktemp -d):/run
95# in addition to the cgroups mount."
96#
97VOLUME [ "/sys/fs/cgroup", "/run" ]
98
99
72ENV PATH /opt/ansible/bin:$PATH 100ENV PATH /opt/ansible/bin:$PATH
73ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH 101ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH
74ENV MANPATH /opt/ansible/docs/man:$MANPATH 102ENV MANPATH /opt/ansible/docs/man:$MANPATH
diff --git a/master-centos7/Dockerfile b/master-centos7/Dockerfile
index 1dfa1ab..51dae60 100644
--- a/master-centos7/Dockerfile
+++ b/master-centos7/Dockerfile
@@ -17,7 +17,22 @@ FROM centos:centos7
17MAINTAINER William Yeh <william.pjyeh@gmail.com> 17MAINTAINER William Yeh <william.pjyeh@gmail.com>
18 18
19 19
20RUN echo "===> Installing EPEL..." && \ 20# enable systemd;
21# @see https://hub.docker.com/_/centos/
22ENV container docker
23
24RUN 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 yum -y update && \ 37 yum -y update && \
23 \ 38 \
@@ -69,6 +84,19 @@ RUN echo "===> Installing EPEL..." && \
69 echo 'localhost' > /etc/ansible/hosts 84 echo 'localhost' > /etc/ansible/hosts
70 85
71 86
87#
88# [Quote] https://hub.docker.com/_/centos/
89#
90# "In order to run a container with systemd,
91# you will need to mount the cgroups volumes from the host.
92# [...]
93# There have been reports that if you're using an Ubuntu host,
94# you will need to add -v /tmp/$(mktemp -d):/run
95# in addition to the cgroups mount."
96#
97VOLUME [ "/sys/fs/cgroup", "/run" ]
98
99
72ENV PATH /opt/ansible/bin:$PATH 100ENV PATH /opt/ansible/bin:$PATH
73ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH 101ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH
74ENV MANPATH /opt/ansible/docs/man:$MANPATH 102ENV MANPATH /opt/ansible/docs/man:$MANPATH