-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
48 lines (33 loc) · 977 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Build
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.20-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG Version
ARG GitCommit
ENV CGO_ENABLED=0
ENV GO111MODULE=on
WORKDIR /go/src/github.com/rverchere/ovh-mks-exporter
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY internal internal
COPY cmd cmd
RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -v \
./cmd/ovh-mks-exporter
# Release
FROM --platform=${TARGETPLATFORM:-linux/amd64} gcr.io/distroless/static:nonroot
LABEL maintainer="Rémi Verchère <[email protected]>"
ENV OVH_ENDPOINT="ovh-eu"
ENV OVH_APPLICATION_KEY=""
ENV OVH_APPLICATION_SECRET=""
ENV OVH_CONSUMER_KEY=""
ENV OVH_CLOUDPROJECT_SERVICENAME=""
ENV OVH_CLOUDPROJECT_KUBEID=""
WORKDIR /
EXPOSE 9101
COPY --from=builder /go/src/github.com/rverchere/ovh-mks-exporter/ovh-mks-exporter /ovh-mks-exporter
USER nonroot:nonroot
CMD [ "/ovh-mks-exporter" ]