docker-keepalived-k8s/Dockerfile

40 lines
1.1 KiB
Docker
Raw Permalink Normal View History

FROM alpine:3.21
LABEL architecture="$TARGETPLATFORM" \
license="beerware" \
name="keepalived" \
summary="Alpine based keepalived container" \
mantainer="antoinroux@hotmail.fr"
RUN apk add --no-cache \
bash \
curl \
keepalived \
gettext \
&& addgroup -S keepalived_script \
&& adduser -S -s /sbin/nologin -G keepalived_script -H keepalived_script
ENV STATE BACKUP
ENV INTERFACE enp3s0
ENV PRIORITY 200
ENV PASSWORD ""
ENV SRC_IP ""
ENV PEER_IP_0 ""
ENV PEER_IP_1 ""
COPY --chmod=750 --chown=keepalived_script:keepalived_script check_apiserver.sh /usr/lib/keepalived/scripts/chk_kube_apiserver.sh
COPY keepalived.template.conf /etc/keepalived/keepalived.template.conf
COPY --chmod=750 init.sh /
ENTRYPOINT ["/init.sh"]
CMD ["/usr/sbin/keepalived", "--dont-fork", "--log-console"]
# Customise keepalived with:
# args: # override options in the Dockerfile
# - --vrrp
# - --log-detail
# - --dump-conf
# - --use-file=/etc/keepalived/keepalived.conf
# CMD ["--vrrp","--log-detail","--dump-conf"]