Various Dockerfile-s
- alertmanager-bot.Dockerfile - rootless
scratch
version of alertmanager-bot - ...
Various Dockerfile-s
scratch
version of alertmanager-botFROM alpine/git:v2.34.2 as build | |
WORKDIR / | |
ARG AM_BOT_VERSION="0.4.3" | |
RUN \ | |
apk add --no-cache ca-certificates~=20211220 \ | |
&& git clone --branch ${AM_BOT_VERSION} https://github.com/metalmatze/alertmanager-bot.git am-repo \ | |
&& wget -c https://github.com/metalmatze/alertmanager-bot/releases/download/${AM_BOT_VERSION}/alertmanager-bot-${AM_BOT_VERSION}-linux-amd64 -O alertmanager-bot | |
RUN addgroup --gid 10001 app \ | |
&& adduser \ | |
--uid 10001 \ | |
--home /home/app \ | |
--shell /bin/ash \ | |
--ingroup app \ | |
--disabled-password \ | |
app | |
# final | |
FROM scratch | |
WORKDIR / | |
ENV TEMPLATE_PATHS=/templates/default.tmpl | |
# copy certs | |
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | |
# copy non-root user-data | |
COPY --from=build /etc/passwd /etc/passwd | |
# copy binary | |
COPY --from=build --chmod=755 /alertmanager-bot ./ | |
# copy alert template | |
COPY --from=build /am-repo/default.tmpl /templates/default.tmpl | |
# user app | |
USER 10001 | |
# default alertmanager-bot port | |
EXPOSE 8080 | |
ENTRYPOINT [ "./alertmanager-bot" ] |