-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (16 loc) · 759 Bytes
/
Copy pathDockerfile
File metadata and controls
22 lines (16 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM --platform=${TARGETPLATFORM} golang:1.20.0 as builder
ENV GOPATH /go/
ENV PATH $GOPATH/bin:$PATH
RUN apt-get update --fix-missing && apt-get --yes install libsystemd-dev
RUN go version
RUN git clone https://github.com/m-lab/alertmanager-github-receiver.git /go/src/github.com/m-lab/alertmanager-github-receiver
WORKDIR /go/src/github.com/m-lab/alertmanager-github-receiver
RUN go mod download
RUN CGO_ENABLED=0 \
go build \
-v \
-ldflags "-X github.com/m-lab/go/prometheusx.GitShortCommit=$(git log -1 --format=%h) -w -s" \
./cmd/github_receiver
FROM --platform=${TARGETPLATFORM} gcr.io/distroless/static
COPY --from=builder /go/src/github.com/m-lab/alertmanager-github-receiver/github_receiver ./
ENTRYPOINT ["/github_receiver"]