-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
23 lines (17 loc) · 1016 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
FROM golang:1.22-alpine as builder
RUN apk update && apk add --no-cache git ca-certificates && update-ca-certificates
WORKDIR /go/src/github.com/scaleway/scaleway-cloud-controller-manager
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY cmd/ cmd/
COPY scaleway/ scaleway/
ARG TAG
ARG COMMIT_SHA
ARG BUILD_DATE
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -ldflags "-w -s -X github.com/scaleway/scaleway-cloud-controller-manager/scaleway.version=${TAG} -X github.com/scaleway/scaleway-cloud-controller-manager/scaleway.buildDate=${BUILD_DATE} -X github.com/scaleway/scaleway-cloud-controller-manager/scaleway.gitCommit=${COMMIT_SHA} " -o scaleway-cloud-controller-manager ./cmd/scaleway-cloud-controller-manager
FROM scratch
WORKDIR /
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/src/github.com/scaleway/scaleway-cloud-controller-manager/scaleway-cloud-controller-manager .
ENTRYPOINT ["/scaleway-cloud-controller-manager"]