forked from aws/secrets-store-csi-driver-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to Go 1.23, address Dockerfile warnings and reorder operations…
… for build cache
- Loading branch information
1 parent
bfca7a4
commit f0baeec
Showing
1 changed file
with
8 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
FROM --platform=$TARGETPLATFORM golang:1.19-alpine as go | ||
ARG TARGETPLATFORM | ||
FROM golang:1.23-alpine AS go | ||
ARG BUILDPLATFORM | ||
ARG TARGETPLATFORM | ||
WORKDIR /workdir | ||
|
||
RUN echo "Running on ${BUILDPLATFORM}, building for ${TARGETPLATFORM}." | ||
RUN apk add git build-base | ||
RUN go env -w GOPROXY=direct | ||
|
||
WORKDIR /workdir | ||
COPY go.mod . | ||
COPY go.sum . | ||
|
||
RUN apk add git build-base | ||
RUN go env -w GOPROXY=direct | ||
RUN go mod download -x | ||
|
||
COPY . . | ||
|
||
RUN go build -v -o _output/secrets-store-csi-driver-provider-aws | ||
|
||
FROM --platform=$TARGETPLATFORM public.ecr.aws/amazonlinux/amazonlinux:2 as al2 | ||
ARG TARGETPLATFORM | ||
FROM public.ecr.aws/amazonlinux/amazonlinux:2 AS al2 | ||
|
||
FROM scratch | ||
|
||
COPY --from=go /workdir/_output/secrets-store-csi-driver-provider-aws /bin/secrets-store-csi-driver-provider-aws | ||
|
||
# Copy current certificates from AL2 (/etc/pki/ symlinked in /etc/ssl/certs/) | ||
COPY --from=al2 /etc/pki/ /etc/pki/ | ||
COPY --from=al2 /etc/ssl/certs/ /etc/ssl/certs | ||
|
||
COPY --from=go /workdir/_output/secrets-store-csi-driver-provider-aws /bin/secrets-store-csi-driver-provider-aws | ||
|
||
ENTRYPOINT ["/bin/secrets-store-csi-driver-provider-aws"] |