2021-10-03 23:19:00 +00:00
|
|
|
ARG ALPINE_VERSION=3.13.6
|
2021-10-03 23:33:53 +00:00
|
|
|
ARG BASE_IMAGE=alpine
|
|
|
|
ARG EMAIL=monit@sutty.nl
|
2022-03-07 21:59:28 +00:00
|
|
|
ARG EMAIL_FROM=monit@sutty.nl
|
2021-10-03 23:33:53 +00:00
|
|
|
FROM ${BASE_IMAGE}:${ALPINE_VERSION} as build
|
2022-03-07 21:59:28 +00:00
|
|
|
ARG EMAIL
|
|
|
|
ARG EMAIL_FROM
|
2021-03-27 13:47:17 +00:00
|
|
|
|
2019-12-20 21:22:00 +00:00
|
|
|
RUN apk add --no-cache tzdata
|
|
|
|
|
2021-03-27 13:47:17 +00:00
|
|
|
COPY ./monitrc /etc/monitrc
|
|
|
|
RUN chmod 600 /etc/monitrc
|
|
|
|
RUN sed -re "s/@@EMAIL@@/${EMAIL}/" -i /etc/monitrc
|
2022-03-07 21:59:28 +00:00
|
|
|
RUN sed -re "s/@@EMAIL_FROM@@/${EMAIL_FROM}/" -i /etc/monitrc
|
2019-09-10 23:24:35 +00:00
|
|
|
|
2021-10-03 23:19:00 +00:00
|
|
|
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
|
2021-10-03 23:42:17 +00:00
|
|
|
ARG ALPINE_VERSION
|
2021-03-27 13:47:25 +00:00
|
|
|
MAINTAINER "f <f@sutty.nl>"
|
|
|
|
|
2021-10-04 16:20:24 +00:00
|
|
|
# Locale
|
|
|
|
ENV LANG="C.UTF-8"
|
|
|
|
|
2021-04-01 18:49:14 +00:00
|
|
|
# Sutty's repository
|
2021-10-03 23:42:17 +00:00
|
|
|
RUN echo ${ALPINE_VERSION} | cut -d . -f 1,2 | xargs -I {} echo https://alpine.sutty.nl/alpine/v{}/sutty | tee -a /etc/apk/repositories
|
2021-04-01 18:49:14 +00:00
|
|
|
RUN wget https://alpine.sutty.nl/alpine/sutty.pub -O /etc/apk/keys/alpine@sutty.nl-5ea884cd.rsa.pub
|
|
|
|
|
2019-09-10 23:24:35 +00:00
|
|
|
# Install monit and remove default config
|
2021-04-01 18:49:14 +00:00
|
|
|
RUN apk add --no-cache tini monit knsupdate
|
2019-12-20 21:22:00 +00:00
|
|
|
COPY --from=build /usr/share/zoneinfo/UTC /etc/localtime
|
2019-09-10 23:24:35 +00:00
|
|
|
|
|
|
|
# Create directories
|
|
|
|
RUN install -dm 2750 -o root -g root /etc/monit.d
|
|
|
|
RUN install -dm 2750 -o root -g root /var/lib/monit
|
|
|
|
|
2021-04-01 18:49:14 +00:00
|
|
|
# Install config
|
2021-03-27 13:47:17 +00:00
|
|
|
COPY --from=build /etc/monitrc /etc/monitrc
|
2021-04-01 18:49:14 +00:00
|
|
|
COPY ./nsupdate.sh /usr/local/bin/nsupdate
|
|
|
|
COPY ./whatsmyip6.sh /usr/local/bin/whatsmyip6
|
2019-09-10 23:24:35 +00:00
|
|
|
|
|
|
|
# Allow access to the web GUI
|
|
|
|
EXPOSE 2812
|
|
|
|
|
|
|
|
# Use tini as init
|
|
|
|
ENTRYPOINT ["/sbin/tini", "--"]
|
|
|
|
|
|
|
|
# Run monit, it will take care of running services afterwards
|
|
|
|
CMD ["/usr/bin/monit"]
|