-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
51 lines (42 loc) · 2.06 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
FROM mkaag/baseimage:latest
MAINTAINER Maurice Kaag <[email protected]>
# -----------------------------------------------------------------------------
# Environment variables
# -----------------------------------------------------------------------------
ENV CONFD_VERSION 0.11.0
# -----------------------------------------------------------------------------
# Pre-install
# -----------------------------------------------------------------------------
RUN \
sed -i 's/^# \(.*-backports\s\)/\1/g' /etc/apt/sources.list && \
echo 'deb http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu trusty main' >> /etc/apt/sources.list; \
echo 'deb-src http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu trusty main' >> /etc/apt/sources.list; \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 505D97A41C61B9CD; \
apt-get update -qqy
# -----------------------------------------------------------------------------
# Install
# -----------------------------------------------------------------------------
RUN \
apt-get install -qqy --no-install-recommends haproxy; \
touch /var/log/haproxy.log; \
chown haproxy: /var/log/haproxy.log
# -----------------------------------------------------------------------------
# Post-install
# -----------------------------------------------------------------------------
ADD build/syslog-ng.conf /etc/syslog-ng/conf.d/haproxy.conf
ADD build/haproxy.toml /etc/confd/conf.d/haproxy.toml
ADD build/haproxy.tmpl /etc/confd/templates/haproxy.tmpl
WORKDIR /usr/local/bin
RUN \
curl -s -L https://github.com/kelseyhightower/confd/releases/download/v$CONFD_VERSION/confd-$CONFD_VERSION-linux-amd64 -o confd; \
chmod +x confd
RUN mkdir /etc/service/haproxy
ADD build/haproxy.sh /etc/service/haproxy/run
RUN chmod +x /etc/service/haproxy/run
EXPOSE 80 443 1936
VOLUME ["/etc/ssl"]
CMD ["/sbin/my_init"]
# -----------------------------------------------------------------------------
# Clean up
# -----------------------------------------------------------------------------
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*