-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.amd64
54 lines (53 loc) · 1.57 KB
/
Dockerfile.amd64
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
FROM alpine:3.8
MAINTAINER Ryan Kuba <[email protected]>
ENV HAPROXY_MAJOR 1.8
ENV HAPROXY_VERSION 1.8.12
ENV HAPROXY_MD5 9f37013ec1e76942a67a9f7c067af9f2
RUN set -x \
\
&& apk add --no-cache --virtual .build-deps \
ca-certificates \
gcc \
libc-dev \
linux-headers \
lua5.3-dev \
make \
openssl \
openssl-dev \
pcre-dev \
readline-dev \
tar \
zlib-dev \
\
&& wget -O haproxy.tar.gz "https://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haproxy-${HAPROXY_VERSION}.tar.gz" \
&& echo "$HAPROXY_MD5 *haproxy.tar.gz" | md5sum -c \
&& mkdir -p /usr/src/haproxy \
&& tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1 \
&& rm haproxy.tar.gz \
\
&& makeOpts=' \
TARGET=linux2628 \
USE_LUA=1 LUA_INC=/usr/include/lua5.3 LUA_LIB=/usr/lib/lua5.3 \
USE_OPENSSL=1 \
USE_PCRE=1 PCREDIR= \
USE_ZLIB=1 \
' \
&& make -C /usr/src/haproxy -j "$(getconf _NPROCESSORS_ONLN)" all $makeOpts \
&& make -C /usr/src/haproxy install-bin $makeOpts \
\
&& 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 --format '%n#p' --recursive /usr/local \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)" \
&& apk add --virtual .haproxy-rundeps $runDeps \
&& apk del .build-deps
COPY docker-entrypoint.sh /
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]