-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
32 lines (22 loc) · 1.06 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
FROM --platform="${BUILDPLATFORM}" docker.io/library/golang:1.23.2-alpine@sha256:9dd2625a1ff2859b8d8b01d8f7822c0f528942fe56cfe7a1e7c38d3b8d72d679 AS build
# renovate: datasource=go depName=github.com/prometheus/promu
ARG PROMU_VERSION=v0.17.0
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
WORKDIR /go/src/app
# hadolint ignore=DL3018
RUN apk add --no-cache git \
&& go install "github.com/prometheus/promu@${PROMU_VERSION}"
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN GOOS="${TARGETOS}" GOARCH="${TARGETARCH}" promu build --verbose
FROM --platform="${TARGETPLATFORM}" quay.io/prometheus/busybox@sha256:dfa54ef35e438b9e71ac5549159074576b6382f95ce1a434088e05fd6b730bc4
LABEL \
org.opencontainers.image.source="https://github.com/maxbrunet/prometheus-elasticache-sd" \
org.opencontainers.image.url="https://github.com/maxbrunet/prometheus-elasticache-sd" \
org.opencontainers.image.licenses="Apache-2.0"
COPY --from=build /go/src/app/prometheus-elasticache-sd /bin/prometheus-elasticache-sd
USER 1000:1000
ENTRYPOINT ["/bin/prometheus-elasticache-sd"]