mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 14:36:03 +02:00
Share the Go build cache when building in Dockerfiles (#1853)
On my machine this makes image rebuilds go from ~5m to 1.5s. This also required setting DOCKER_BUILDKIT=1 in integration test image builds. I also took the opportunity to bump the Go version used in those tests to Go 1.17 to match the image build processes, and tidied up the workflow files a bit too (renaming for consistency, typos, whitespace, etc.)
This commit is contained in:
@@ -35,8 +35,11 @@ RUN go install github.com/chrismellard/docker-credential-acr-env@09e2b5a8ac86c3e
|
||||
RUN mkdir -p /kaniko/.docker
|
||||
|
||||
COPY . .
|
||||
RUN make GOARCH=$TARGETARCH
|
||||
RUN make GOARCH=$TARGETARCH out/warmer
|
||||
RUN \
|
||||
--mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/go/pkg \
|
||||
make GOARCH=$TARGETARCH && \
|
||||
make GOARCH=$TARGETARCH out/warmer
|
||||
|
||||
# Generate latest ca-certificates
|
||||
|
||||
|
||||
Reference in New Issue
Block a user