forked from atr0phy/aws_batch_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (25 loc) · 930 Bytes
/
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
FROM golang:1.23.4-alpine AS builder
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT=""
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH} \
GOARM=${TARGETVARIANT}
RUN apk add --no-cache ca-certificates tini-static \
&& update-ca-certificates
WORKDIR /build
COPY . .
RUN go build -o aws_batch_exporter /build/cmd/aws_batch_exporter.go
FROM gcr.io/distroless/static:nonroot
ENV PORT=8080
USER nonroot:nonroot
COPY --from=builder --chown=nonroot:nonroot /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder --chown=nonroot:nonroot /sbin/tini-static /tini
COPY --from=builder --chown=nonroot:nonroot /build/aws_batch_exporter /aws_batch_exporter
ENTRYPOINT [ "/tini", "--", "/aws_batch_exporter" ]
EXPOSE ${PORT}
LABEL \
org.opencontainers.image.title="aws-batch-exporter" \
org.opencontainers.image.source="https://github.com/montblu/aws-batch-exporter"