File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,18 +2,21 @@ FROM --platform=$BUILDPLATFORM golang:1.25-alpine3.22 AS builder
22
33WORKDIR /workspace
44
5- COPY go.mod .
6- COPY go.sum .
5+ COPY go.mod go.sum ./
76
8- RUN go mod download
7+ RUN --mount=type=cache,id=gomodcache,target=/go/pkg/mod \
8+ --mount=type=cache,id=gobuildcache,target=/root/.cache/go-build \
9+ go mod download
910
10- COPY . /workspace
11-
12- RUN go mod tidy
11+ COPY . .
1312
1413# Build
15- ARG TARGETOS TARGETARCH
16- RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o ./build/_output/bin/postgres-operator \
14+ ARG TARGETOS
15+ ARG TARGETARCH
16+
17+ RUN --mount=type=cache,id=gomodcache,target=/go/pkg/mod \
18+ --mount=type=cache,id=gobuildcache,target=/root/.cache/go-build \
19+ CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o ./build/_output/bin/postgres-operator \
1720 -gcflags all=-trimpath=${GOPATH} -asmflags all=-trimpath=${GOPATH} ./cmd/pgskipper-operator
1821
1922FROM alpine:3.22
You can’t perform that action at this time.
0 commit comments