forked from benjojo/alertmanager-discord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (35 loc) · 1.78 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
FROM golang:alpine as builder
LABEL org.opencontainers.image.title="alertmanager-discord builder" \
org.opencontainers.image.description="alertmanager-discord builder" \
org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.source="https://github.com/SimplicityGuy/alertmanager-discord/blob/main/Dockerfile" \
org.opencontainers.image.licenses="Apache" \
org.opencontainers.image.created="$(date +'%Y-%m-%d')" \
org.opencontainers.image.base.name="docker.io/library/golang:alpine"
# hadolint ignore=DL3018
RUN apk update --quiet && \
apk upgrade --quiet && \
apk add --quiet --no-cache \
ca-certificates \
git && \
rm /var/cache/apk/* && \
adduser -D -g '' notifier
COPY . $GOPATH/src/alertmanager-discord/
WORKDIR $GOPATH/src/alertmanager-discord/
RUN go get -d -v && \
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags="-w -s" -o /go/bin/alertmanager-discord
FROM scratch
LABEL org.opencontainers.image.title="alertmanager-discord" \
org.opencontainers.image.description="Take your alertmanager alerts, into discord." \
org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.source="https://github.com/SimplicityGuy/alertmanager-discord/blob/main/Dockerfile" \
org.opencontainers.image.licenses="Apache" \
org.opencontainers.image.created="$(date +'%Y-%m-%d')" \
org.opencontainers.image.base.name="docker.io/library/scratch"
ENV LISTEN_ADDRESS=0.0.0.0:9094
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /go/bin/alertmanager-discord /go/bin/alertmanager-discord
EXPOSE 9094
USER notifier
ENTRYPOINT ["/go/bin/alertmanager-discord"]