forked from mesosphere/marathon-lb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
96 lines (86 loc) · 2.96 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
FROM debian:stretch
# runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
iptables \
libcurl3 \
liblua5.3-0 \
libssl1.0.2 \
openssl \
procps \
python3 \
runit \
socat \
&& rm -rf /var/lib/apt/lists/*
ENV TINI_VERSION=v0.13.2 \
TINI_GPG_KEY=595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7
RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends dirmngr gpg wget \
&& rm -rf /var/lib/apt/lists/* \
&& wget -O tini "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-amd64" \
&& wget -O tini.asc "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-amd64.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$TINI_GPG_KEY" \
&& gpg --batch --verify tini.asc tini \
&& rm -rf "$GNUPGHOME" tini.asc \
&& mv tini /usr/bin/tini \
&& chmod +x /usr/bin/tini \
&& tini -- true \
&& apt-get purge -y --auto-remove dirmngr gpg wget
ENV HAPROXY_MAJOR=1.7 \
HAPROXY_VERSION=1.7.2 \
HAPROXY_MD5=7330b36f3764ebe409e9305803dc30e2
COPY requirements.txt /marathon-lb/
RUN set -x \
&& buildDeps=' \
gcc \
libcurl4-openssl-dev \
libffi-dev \
liblua5.3-dev \
libpcre3-dev \
libssl-dev \
make \
python3-dev \
python3-pip \
python3-setuptools \
wget \
zlib1g-dev \
' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& rm -rf /var/lib/apt/lists/* \
\
# Build HAProxy
&& 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 \
&& make -C /usr/src/haproxy \
TARGET=linux2628 \
ARCH=x86_64 \
USE_LUA=1 \
LUA_INC=/usr/include/lua5.3/ \
USE_OPENSSL=1 \
USE_PCRE_JIT=1 \
USE_PCRE=1 \
USE_REGPARM=1 \
USE_STATIC_PCRE=1 \
USE_ZLIB=1 \
all \
install-bin \
&& rm -rf /usr/src/haproxy \
\
# Install Python dependencies
# Install Python packages with --upgrade so we get new packages even if a system
# package is already installed. Combine with --force-reinstall to ensure we get
# a local package even if the system package is up-to-date as the system package
# will probably be uninstalled with the build dependencies.
&& pip3 install --no-cache --upgrade --force-reinstall -r /marathon-lb/requirements.txt \
\
&& apt-get purge -y --auto-remove $buildDeps
COPY . /marathon-lb
WORKDIR /marathon-lb
ENTRYPOINT [ "tini", "-g", "--", "/marathon-lb/run" ]
CMD [ "sse", "--health-check", "--group", "external" ]
EXPOSE 80 443 9090 9091