forked from janeczku/keepalived-ingress-vip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (23 loc) · 1.2 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
FROM alpine:3.12.0
ENV GOMPLATE_VERSION=v3.7.0 \
GOMPLATE_BASEURL=https://github.com/hairyhenderson/gomplate/releases/download \
DUMBINIT_VERSION=v1.2.2 \
DUMBINIT_BASEURL=https://github.com/Yelp/dumb-init/releases/download/ \
KEEPALIVED_VERSION=2.0.20-r0
ARG TARGETARCH
# Install keepalived
RUN apk add --no-cache file ca-certificates bash coreutils curl net-tools jq keepalived=${KEEPALIVED_VERSION} \
&& rm -f /etc/keepalived/keepalived.conf \
&& addgroup -S keepalived_script && adduser -D -S -G keepalived_script keepalived_script
# Install gomplate
RUN curl -sL ${GOMPLATE_BASEURL}/${GOMPLATE_VERSION}/gomplate_linux-${TARGETARCH} --output /bin/gomplate \
&& chmod +x /bin/gomplate
# Install dumb-init
RUN curl -sL ${DUMBINIT_BASEURL}/${DUMBINIT_VERSION}/dumb-init_1.2.2_${TARGETARCH} --output /bin/dumb-init \
&& chmod +x /bin/dumb-init
COPY keepalived.conf.tmpl /etc/keepalived/keepalived.conf.tmpl
COPY vrrp_check.sh /opt/bin/vrrp_check.sh
ENTRYPOINT ["/bin/dumb-init", "--", \
"/bin/gomplate", "-f", "/etc/keepalived/keepalived.conf.tmpl", "-o", "/etc/keepalived/keepalived.conf", "--" \
]
CMD [ "/usr/sbin/keepalived", "-l", "-n", "-f", "/etc/keepalived/keepalived.conf" ]