-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathDockerfile
56 lines (43 loc) · 2.05 KB
/
Dockerfile
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
48
49
50
51
52
53
54
55
FROM centos:centos6
MAINTAINER Hiroaki Sano <hiroaki.sano.9stories@gmail.com>
# Basic packages
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm \
&& yum -y install passwd sudo git wget openssl openssh openssh-server openssh-clients jq
# Create user
RUN useradd hiroakis \
&& echo "hiroakis" | passwd hiroakis --stdin \
&& sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config \
&& sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config \
&& echo "hiroakis ALL=(ALL) ALL" >> /etc/sudoers.d/hiroakis
# Redis
RUN yum install -y redis
# RabbitMQ
RUN yum install -y socat \
&& rpm -Uvh https://github.com/rabbitmq/erlang-rpm/releases/download/v20.1.7/erlang-20.1.7-1.el6.x86_64.rpm \
&& rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc \
&& rpm -Uvh https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.0/rabbitmq-server-3.7.0-1.el6.noarch.rpm \
&& git clone git://github.com/joemiller/joemiller.me-intro-to-sensu.git \
&& cd joemiller.me-intro-to-sensu/; ./ssl_certs.sh clean && ./ssl_certs.sh generate \
&& mkdir /etc/rabbitmq/ssl \
&& cp /joemiller.me-intro-to-sensu/server_cert.pem /etc/rabbitmq/ssl/cert.pem \
&& cp /joemiller.me-intro-to-sensu/server_key.pem /etc/rabbitmq/ssl/key.pem \
&& cp /joemiller.me-intro-to-sensu/testca/cacert.pem /etc/rabbitmq/ssl/
ADD ./files/rabbitmq.config /etc/rabbitmq/
RUN rabbitmq-plugins enable rabbitmq_management
# Sensu server
ADD ./files/sensu.repo /etc/yum.repos.d/
RUN yum install -y sensu
ADD ./files/config.json /etc/sensu/
RUN mkdir -p /etc/sensu/ssl \
&& cp /joemiller.me-intro-to-sensu/client_cert.pem /etc/sensu/ssl/cert.pem \
&& cp /joemiller.me-intro-to-sensu/client_key.pem /etc/sensu/ssl/key.pem
# uchiwa
RUN yum install -y uchiwa
ADD ./files/uchiwa.json /etc/sensu/
# supervisord
RUN wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py \
&& pip install supervisor
ADD files/supervisord.conf /etc/supervisord.conf
RUN /etc/init.d/sshd start && /etc/init.d/sshd stop
EXPOSE 22 3000 4567 5671 15672
CMD ["/usr/bin/supervisord"]