-
Notifications
You must be signed in to change notification settings - Fork 161
/
Dockerfile
46 lines (43 loc) · 1.38 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
FROM alpine:3.3
ENV HAPROXY_MAJOR 1.6
ENV HAPROXY_VERSION 1.6.5
ENV HAPROXY_MD5 5290f278c04e682e42ab71fed26fc082
# 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
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]