-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
72 lines (66 loc) · 2.23 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
FROM alpine:3.4
ENV HAPROXY_MAJOR 1.6
ENV HAPROXY_VERSION 1.6.9
ENV HAPROXY_MD5 c52eee40eb66f290d6f089c339b9d2b3
# see http://sources.debian.net/src/haproxy/1.5.8-1/debian/rules/ for some helpful navigation of the possible "make" arguments
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
curl \
gcc \
libc-dev \
linux-headers \
make \
openssl-dev \
pcre-dev \
zlib-dev \
&& curl -SL "http://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haproxy-${HAPROXY_VERSION}.tar.gz" -o haproxy.tar.gz \
&& echo "${HAPROXY_MD5} haproxy.tar.gz" | md5sum -c \
&& mkdir -p /usr/src \
&& tar -xzf haproxy.tar.gz -C /usr/src \
&& mv "/usr/src/haproxy-$HAPROXY_VERSION" /usr/src/haproxy \
&& rm haproxy.tar.gz \
&& make -C /usr/src/haproxy \
TARGET=linux2628 \
USE_PCRE=1 PCREDIR= \
USE_OPENSSL=1 \
USE_ZLIB=1 \
all \
install-bin \
&& mkdir -p /usr/local/etc/haproxy \
&& cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors \
&& rm -rf /usr/src/haproxy \
&& runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .haproxy-rundeps $runDeps \
&& apk del .build-deps
# Customisation from haproxy upstream
RUN apk add --no-cache inotify-tools curl python py-pip && \
pip install requests
ENV STACK_DOMAIN none
ENV ENABLE_STATS false
ENV STATS_PORT 1936
ENV STATS_USERNAME haproxy
ENV STATS_PASSWORD haproxy
ENV ENABLE_SSL false
ENV ENABLE_SSL_REDIRECTION false
ENV SSL_REDIRECTION_TYPE 301
ENV SSL_BASE64_ENCODED false
ENV DISABLE_METADATA false
ENV HAPROXY_CONFIG /usr/local/etc/haproxy/haproxy.cfg
ENV HAPROXY_SSL_CERT /usr/local/etc/haproxy/server.pem
ENV HAPROXY_BACKEND_CONFIG /usr/local/etc/haproxy/haproxy-backends.cfg
ENV HAPROXY_DOMAIN_MAP /usr/local/etc/haproxy/domain.map
ENV RANCHER_API_HOST rancher-metadata.rancher.internal
ENV RANCHER_API_VERSION 2015-12-19
ENV RANCHER_LABEL map-public-http
ENV RANCHER_PROXY_LABEL send-proxy
COPY gen-haproxy-map.py /
COPY docker-entrypoint.sh /
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["haproxy"]