forked from jacksoncage/salt-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-centos7
47 lines (39 loc) · 1.57 KB
/
Dockerfile-centos7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM centos:7
MAINTAINER Viktor Hansson "viktor.hansson@dataductus.se"
ENV container docker
STOPSIGNAL 37
#Remove systemd files that will mess stuff up inside docker
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/*;
# Required for systemd to work at all
VOLUME [ "/sys/fs/cgroup" ]
# Required to run docker inside docker, since AUFS inside AUFS is not possible
VOLUME [ "/var/lib/docker" ]
# Install the Saltstack 2016.11 minion
RUN yum install -y https://repo.saltstack.com/yum/redhat/salt-repo-2016.11-2.el7.noarch.rpm epel-release && \
yum clean expire-cache && \
yum install -y salt-master salt-minion salt-api python-pip sudo git && \
yum clean all && \
pip install gitpython
# Install docker
RUN yum install -y yum-utils device-mapper-persistent-data lvm2 && \
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
yum makecache fast && \
yum install docker-ce -y
# Add salt config files
ADD etc/master /etc/salt/master_template
ADD etc/minion /etc/salt/minion_template
# Exposing salt master ports
EXPOSE 4505 4506
# Add and set start script
ADD start.sh /start.sh
CMD ["bash", "start.sh"]