Open kaovilai opened 1 week ago
/kind changelog-not-required
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 58.97%. Comparing base (
7a51e0d
) to head (1051dee
). Report is 16 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
With this (https://github.com/vmware-tanzu/velero/commit/cd4423e76c270cde5122bba141482f0f4464b299) change, subsequent runs of make all-containers
takes around 1 minute for two arch builds.
make all-containers 0.90s user 1.02s system 2% cpu 1:05.02 total
``` ❯ time make all-containers [+] Building 62.3s (38/38) FINISHED kubernetes:crc => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 4.13kB 0.0s => [linux/arm64 internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.1s => [linux/arm64 internal] load metadata for docker.io/library/golang:1.22-bookworm 0.2s => [linux/amd64 internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.1s => [internal] load .dockerignore 0.0s => => transferring context: 60B 0.0s => CACHED [linux/arm64 stage-4 1/4] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => [internal] load build context 0.2s => => transferring context: 549.27kB 0.2s => [linux/arm64 restic-builder 1/6] FROM docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3d 0.0s => => resolve docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18b99b4 0.0s => CACHED [linux/amd64 stage-4 1/4] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => CACHED [linux/arm64 velero-builder-base 5/6] COPY . /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [linux/arm64 velero-builder-base 4/6] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb go mod download 0.0s => CACHED [linux/arm64 restic-builder 2/6] RUN mkdir -p /output/usr/bin 0.0s => CACHED [linux/arm64 restic-builder 3/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then 0.0s => CACHED [linux/arm64 restic-builder 4/6] COPY hack/fix_restic_cve.txt /go/src/github.com/vmware-tanzu/velero/hack/ 0.0s => CACHED [linux/arm64 restic-builder 5/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then 0.0s => CACHED [linux/arm64 restic-builder 6/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then 0.0s => CACHED [linux/arm64->amd64 velero-builder-base 5/6] COPY . /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [linux/arm64->amd64 velero-builder-base 4/6] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb go mod download 0.0s => CACHED [linux/arm64->amd64 velero-builder-base 6/6] RUN mkdir -p /output/usr/bin 0.0s => CACHED [linux/arm64->amd64 velero-builder 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go bui 0.0s => CACHED [linux/arm64 velero-builder-base 3/6] COPY go.mod go.sum /go/src/github.com/vmware-tanzu/velero/ 0.0s => CACHED [linux/arm64 velero-builder-base 2/6] WORKDIR /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [linux/arm64->amd64 restic-builder 2/6] RUN mkdir -p /output/usr/bin 0.0s => CACHED [linux/arm64->amd64 restic-builder 3/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then 0.0s => CACHED [linux/arm64->amd64 restic-builder 4/6] COPY hack/fix_restic_cve.txt /go/src/github.com/vmware-tanzu/velero/hack/ 0.0s => CACHED [linux/arm64->amd64 restic-builder 5/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then 0.0s => CACHED [linux/arm64->amd64 restic-builder 6/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then 0.0s => CACHED [linux/arm64->amd64 velero-builder-helper 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) 0.0s => [linux/arm64 velero-builder-base 6/6] RUN mkdir -p /output/usr/bin 11.8s => [linux/amd64 stage-4 2/4] COPY --from=velero-builder /output / 12.0s => [linux/arm64 velero-builder 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o /output 41.8s => [linux/arm64 velero-builder-helper 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o / 7.0s => [linux/amd64 stage-4 3/4] COPY --from=velero-builder-helper /output / 3.8s => [linux/amd64 stage-4 4/4] COPY --from=restic-builder /output / 0.1s => [linux/arm64 stage-4 2/4] COPY --from=velero-builder /output / 0.8s => [linux/arm64 stage-4 3/4] COPY --from=velero-builder-helper /output / 0.3s => [linux/arm64 stage-4 4/4] COPY --from=restic-builder /output / 0.2s => exporting to image 5.4s => => exporting layers 5.2s => => exporting manifest sha256:49b74f7455775642695b4c3b134d13f421c67893f5d9e9e30fa5bbd0776fdfd7 0.0s => => exporting config sha256:e8e8156f5fa2906379170dbbb8b832d7906f564a74404ac9846945ffd46b049a 0.0s => => exporting attestation manifest sha256:dbe7ef0d3dafab6ae4cc0d9bd7c580dc9d7e1edadc6599b3f224c2fc34b442a5 0.0s => => exporting manifest sha256:55e05df932a39ae8dd8b7a48a150860707a2339aed46485c4470e40555ca4911 0.0s => => exporting config sha256:335027a44320d2ed242f3b1b1b5cc38b4a0da901dc794838e8124f5438ce7a87 0.0s => => exporting attestation manifest sha256:beb1de9638f043a778371fa2a4bc14acee41d081fc8332bb8d1d8f561e3529cd 0.0s => => exporting manifest list sha256:31615f524709109e9f69ce0bb9be978c0496748b568436cf1e9510ac2b601fe5 0.0s container: velero/velero:main [+] Building 1.0s (40/40) FINISHED kubernetes:crc => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 4.13kB 0.0s => [linux/arm64 internal] load metadata for docker.io/library/golang:1.22-bookworm 0.3s => [linux/arm64 internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.3s => [linux/amd64 internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.3s => [auth] library/golang:pull token for registry-1.docker.io 0.0s => [auth] paketobuildpacks/run-jammy-tiny:pull token for registry-1.docker.io 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 60B 0.0s => [linux/arm64 restic-builder 1/6] FROM docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3d 0.0s => => resolve docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18b99b4 0.0s => [linux/arm64 stage-4 1/4] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab7 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => [internal] load build context 0.5s => => transferring context: 549.27kB 0.5s => [linux/amd64 stage-4 1/4] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab7 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => CACHED [linux/arm64 velero-builder-base 2/6] WORKDIR /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [linux/arm64 velero-builder-base 3/6] COPY go.mod go.sum /go/src/github.com/vmware-tanzu/velero/ 0.0s => CACHED [linux/arm64->amd64 velero-builder-base 4/6] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb go mod download 0.0s => CACHED [linux/arm64->amd64 velero-builder-base 5/6] COPY . /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [linux/arm64->amd64 velero-builder-base 6/6] RUN mkdir -p /output/usr/bin 0.0s => CACHED [linux/arm64->amd64 velero-builder 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go bui 0.0s => CACHED [linux/amd64 stage-4 2/4] COPY --from=velero-builder /output / 0.0s => CACHED [linux/arm64->amd64 velero-builder-helper 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) 0.0s => CACHED [linux/amd64 stage-4 3/4] COPY --from=velero-builder-helper /output / 0.0s => CACHED [linux/arm64->amd64 restic-builder 2/6] RUN mkdir -p /output/usr/bin 0.0s => CACHED [linux/arm64->amd64 restic-builder 3/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = " 0.0s => CACHED [linux/arm64->amd64 restic-builder 4/6] COPY hack/fix_restic_cve.txt /go/src/github.com/vmware-tanzu/velero/hack/ 0.0s => CACHED [linux/arm64->amd64 restic-builder 5/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = " 0.0s => CACHED [linux/arm64->amd64 restic-builder 6/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = " 0.0s => CACHED [linux/amd64 stage-4 4/4] COPY --from=restic-builder /output / 0.0s => CACHED [linux/arm64 velero-builder-base 4/6] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb go mod download 0.0s => CACHED [linux/arm64 velero-builder-base 5/6] COPY . /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [linux/arm64 velero-builder-base 6/6] RUN mkdir -p /output/usr/bin 0.0s => CACHED [linux/arm64 velero-builder 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o / 0.0s => CACHED [linux/arm64 stage-4 2/4] COPY --from=velero-builder /output / 0.0s => CACHED [linux/arm64 velero-builder-helper 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go bui 0.0s => CACHED [linux/arm64 stage-4 3/4] COPY --from=velero-builder-helper /output / 0.0s => CACHED [linux/arm64 restic-builder 2/6] RUN mkdir -p /output/usr/bin 0.0s => CACHED [linux/arm64 restic-builder 3/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = "velero" 0.0s => CACHED [linux/arm64 restic-builder 4/6] COPY hack/fix_restic_cve.txt /go/src/github.com/vmware-tanzu/velero/hack/ 0.0s => CACHED [linux/arm64 restic-builder 5/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = "velero" 0.0s => CACHED [linux/arm64 restic-builder 6/6] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = "velero" 0.0s => CACHED [linux/arm64 stage-4 4/4] COPY --from=restic-builder /output / 0.0s => exporting to image 0.1s => => exporting layers 0.0s => => exporting manifest sha256:13de3066416a9d84ebf0e7b7e2ee2f2674070db798df0307a1c56c55b6f3b9eb 0.0s => => exporting config sha256:daee5f0770953e586e93d397002ccbc5f6ea6adf4a0dac9c79f6c06f703143ed 0.0s => => exporting attestation manifest sha256:7f70233a64b35ea6c45972ec4f1ee7c377061906ce074fdb943e7a7f216a0fa2 0.0s => => exporting manifest sha256:8fea92ecef4c205dde9813acab394749f8668f766d4de65b1a49e942283887a8 0.0s => => exporting config sha256:19dea8bd4a1c400f512c43ab2c3421c23b0571fbdfc689ec7c167977fd12aec7 0.0s => => exporting attestation manifest sha256:65556c4f5431a89003b82a77c05f5b2a8368756c870fe99485754e1a7a50e7be 0.0s => => exporting manifest list sha256:7002c330f47a07b1a9ecbf4904dff7437c3aac39e66aa28004fb779521bc1ae5 0.0s container: velero/velero-restore-helper:main make all-containers 0.90s user 1.02s system 2% cpu 1:05.02 total ```
as of https://github.com/vmware-tanzu/velero/commit/e46515963a901bf9df63f11d379f0a4d6401ac31 Making one .go change and rebuild saves about 15s vs main branch 🤷
export BUILDX_PLATFORMS=linux/arm64; make all-containers && echo "// test cache" >> pkg/constant/constant.go && time make all-containers
...
make all-containers 0.87s user 0.90s system 2% cpu 1:15.95 total
```shell export BUILDX_PLATFORMS=linux/arm64; make all-containers && echo "// test cache" >> pkg/constant/constant.go && time make all-containers [+] Building 0.7s (26/26) FINISHED kubernetes:crc => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 4.05kB 0.0s => [internal] load metadata for docker.io/library/golang:1.22-bookworm 0.3s => [internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.3s => [auth] paketobuildpacks/run-jammy-tiny:pull token for registry-1.docker.io 0.0s => [auth] library/golang:pull token for registry-1.docker.io 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 60B 0.0s => [stage-4 1/4] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => [restic-builder 1/7] FROM docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18 0.0s => => resolve docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18b99b4 0.0s => [internal] load build context 0.3s => => transferring context: 561.56kB 0.3s => CACHED [velero-builder-base 2/6] RUN mkdir -p /output/usr/bin 0.0s => CACHED [velero-builder-base 3/6] WORKDIR /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [velero-builder-base 4/6] COPY go.mod go.sum /go/src/github.com/vmware-tanzu/velero/ 0.0s => CACHED [velero-builder-base 5/6] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb go mod download 0.0s => CACHED [velero-builder-base 6/6] COPY . /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [velero-builder 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o /output/veler 0.0s => CACHED [stage-4 2/4] COPY --from=velero-builder /output / 0.0s => CACHED [velero-builder-helper 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o /outpu 0.0s => CACHED [stage-4 3/4] COPY --from=velero-builder-helper /output / 0.0s => CACHED [restic-builder 2/7] RUN mkdir -p /output/usr/bin && mkdir -p /build/restic 0.0s => CACHED [restic-builder 3/7] WORKDIR /build/restic 0.0s => CACHED [restic-builder 4/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then git clone 0.0s => CACHED [restic-builder 5/7] COPY hack/fix_restic_cve.txt /go/src/github.com/vmware-tanzu/velero/hack/ 0.0s => CACHED [restic-builder 6/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then git apply 0.0s => CACHED [restic-builder 7/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then GOARM=$(ec 0.0s => CACHED [stage-4 4/4] COPY --from=restic-builder /output / 0.0s => exporting to image 0.1s => => exporting layers 0.0s => => exporting manifest sha256:dcfbf179655194c22da2659e05a68ea402f1d1549ff0a6b1d3ca32a73ea49333 0.0s => => exporting config sha256:c5dc14d0311b58770a32d62e5206deec2a416c8b7a70bcc7ceebd7f82217c711 0.0s => => exporting attestation manifest sha256:1647713ba73b9d510d193c64a33df1f0a1d6c66462ed12a3e86adfbd005dc436 0.0s => => exporting manifest list sha256:7037efc2a8a65ed211f09b845f3dbb45008e31e7932c09c49791396521595689 0.0s container: velero/velero:main [+] Building 0.4s (24/24) FINISHED kubernetes:crc => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 4.05kB 0.0s => [internal] load metadata for docker.io/library/golang:1.22-bookworm 0.1s => [internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.1s => [internal] load .dockerignore 0.0s => => transferring context: 60B 0.0s => [restic-builder 1/7] FROM docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18 0.0s => => resolve docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18b99b4 0.0s => [internal] load build context 0.2s => => transferring context: 543.23kB 0.2s => [stage-4 1/4] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => CACHED [velero-builder-base 2/6] RUN mkdir -p /output/usr/bin 0.0s => CACHED [velero-builder-base 3/6] WORKDIR /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [velero-builder-base 4/6] COPY go.mod go.sum /go/src/github.com/vmware-tanzu/velero/ 0.0s => CACHED [velero-builder-base 5/6] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb go mod download 0.0s => CACHED [velero-builder-base 6/6] COPY . /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [velero-builder 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o /output/veler 0.0s => CACHED [stage-4 2/4] COPY --from=velero-builder /output / 0.0s => CACHED [velero-builder-helper 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o /outpu 0.0s => CACHED [stage-4 3/4] COPY --from=velero-builder-helper /output / 0.0s => CACHED [restic-builder 2/7] RUN mkdir -p /output/usr/bin && mkdir -p /build/restic 0.0s => CACHED [restic-builder 3/7] WORKDIR /build/restic 0.0s => CACHED [restic-builder 4/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = "velero" ]; then 0.0s => CACHED [restic-builder 5/7] COPY hack/fix_restic_cve.txt /go/src/github.com/vmware-tanzu/velero/hack/ 0.0s => CACHED [restic-builder 6/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = "velero" ]; then 0.0s => CACHED [restic-builder 7/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = "velero" ]; then 0.0s => CACHED [stage-4 4/4] COPY --from=restic-builder /output / 0.0s => exporting to image 0.1s => => exporting layers 0.0s => => exporting manifest sha256:255255475f956eab91df8fcc77f4bb5227b16c8107f694efa287eb955879296a 0.0s => => exporting config sha256:b963c6d13b12412bd87fba4fedbf7f88a9dfdf10c37eaf5b7e1d05177e6ccefb 0.0s => => exporting attestation manifest sha256:ff8d442eda7b9fab5480296f8f654beb4b9316c77d9575ab2839ebb236f90d0a 0.0s => => exporting manifest list sha256:bfb0cc9ad1cacf09e849c960eb218f9ce03b8646b841b62cb48c2a1592a13730 0.0s container: velero/velero-restore-helper:main [+] Building 52.4s (24/24) FINISHED kubernetes:crc => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 4.05kB 0.0s => [internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.1s => [internal] load metadata for docker.io/library/golang:1.22-bookworm 0.1s => [internal] load .dockerignore 0.0s => => transferring context: 60B 0.0s => CACHED [restic-builder 1/7] FROM docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def654 0.0s => => resolve docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18b99b4 0.0s => CACHED [stage-4 1/4] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a6 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => [internal] load build context 0.2s => => transferring context: 544.21kB 0.2s => [velero-builder-base 2/6] RUN mkdir -p /output/usr/bin 2.9s => [velero-builder-base 3/6] WORKDIR /go/src/github.com/vmware-tanzu/velero 2.0s => [velero-builder-base 4/6] COPY go.mod go.sum /go/src/github.com/vmware-tanzu/velero/ 1.8s => [velero-builder-base 5/6] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb go mod download 1.8s => [velero-builder-base 6/6] COPY . /go/src/github.com/vmware-tanzu/velero 2.0s => [velero-builder 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o /output/velero 37.7s => [velero-builder-helper 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o /output/veler 4.9s => CACHED [restic-builder 2/7] RUN mkdir -p /output/usr/bin && mkdir -p /build/restic 0.0s => CACHED [restic-builder 3/7] WORKDIR /build/restic 0.0s => CACHED [restic-builder 4/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then git clone 0.0s => CACHED [restic-builder 5/7] COPY hack/fix_restic_cve.txt /go/src/github.com/vmware-tanzu/velero/hack/ 0.0s => CACHED [restic-builder 6/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then git apply 0.0s => CACHED [restic-builder 7/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero" = "velero" ]; then GOARM=$(ec 0.0s => [stage-4 2/4] COPY --from=velero-builder /output / 0.3s => [stage-4 3/4] COPY --from=velero-builder-helper /output / 0.2s => [stage-4 4/4] COPY --from=restic-builder /output / 0.1s => exporting to image 3.1s => => exporting layers 3.0s => => exporting manifest sha256:c823dfc0ba2540e89ab6594ef91c18aec4c1633cd777e21d06591a740e10022a 0.0s => => exporting config sha256:ce5ecab4a7989ca4e673977cad3a1fcfec4fb9b43631d04f8a6fffe188a709c2 0.0s => => exporting attestation manifest sha256:b474847335e75a25362468baaadfa89ee505825aa3f68735e4c0275d1f482840 0.0s => => exporting manifest list sha256:772be783cef2ecd2579fcc51200b7d463f663afd21a7f041e95069326ce8eb26 0.0s container: velero/velero:main [+] Building 22.3s (24/24) FINISHED kubernetes:crc => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 4.05kB 0.0s => [internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.2s => [internal] load metadata for docker.io/library/golang:1.22-bookworm 0.2s => [internal] load .dockerignore 0.0s => => transferring context: 60B 0.0s => CACHED [restic-builder 1/7] FROM docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def654 0.0s => => resolve docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18b99b4 0.0s => [internal] load build context 0.2s => => transferring context: 561.56kB 0.2s => CACHED [stage-4 1/4] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a6 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => [velero-builder-base 2/6] RUN mkdir -p /output/usr/bin 2.1s => [velero-builder-base 3/6] WORKDIR /go/src/github.com/vmware-tanzu/velero 1.7s => [velero-builder-base 4/6] COPY go.mod go.sum /go/src/github.com/vmware-tanzu/velero/ 1.6s => [velero-builder-base 5/6] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb go mod download 2.1s => [velero-builder-base 6/6] COPY . /go/src/github.com/vmware-tanzu/velero 6.6s => [velero-builder 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o /output/velero-resto 4.7s => [velero-builder-helper 1/1] RUN --mount=type=cache,target=/go/pkg/mod,id=vbb GOARM=$( echo "" | cut -c2-) go build -o /output/veler 6.8s => [stage-4 2/4] COPY --from=velero-builder /output / 0.1s => CACHED [restic-builder 2/7] RUN mkdir -p /output/usr/bin && mkdir -p /build/restic 0.0s => CACHED [restic-builder 3/7] WORKDIR /build/restic 0.0s => CACHED [restic-builder 4/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = "velero" ]; then 0.0s => CACHED [restic-builder 5/7] COPY hack/fix_restic_cve.txt /go/src/github.com/vmware-tanzu/velero/hack/ 0.0s => CACHED [restic-builder 6/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = "velero" ]; then 0.0s => CACHED [restic-builder 7/7] RUN --mount=type=cache,target=/go/pkg/mod,id=restic if [ "velero-restore-helper" = "velero" ]; then 0.0s => [stage-4 3/4] COPY --from=velero-builder-helper /output / 0.1s => [stage-4 4/4] COPY --from=restic-builder /output / 0.1s => exporting to image 0.7s => => exporting layers 0.6s => => exporting manifest sha256:90d5e28e7f7af8a3f3f7d7644dd966d158decb4c8234ae2add50bcfd5c78be42 0.0s => => exporting config sha256:874f8a23969c0475ab6935408fea9df2fb66ff5a1e2464ec20255c59239caef2 0.0s => => exporting attestation manifest sha256:1e80048ae5da47811786af550b7f51f41ac177b089053f161ee3a75f963fa080 0.0s => => exporting manifest list sha256:a417ed6e4df5a1443c637f51e3e90eff5d0041566437a69a48cd14d91a975a10 0.0s container: velero/velero-restore-helper:main make all-containers 0.87s user 0.90s system 2% cpu 1:15.95 total ```
vs main branch
git reset --hard && git checkout upstream/main && export BUILDX_PLATFORMS=linux/arm64; make all-containers && echo "// test cache" >> pkg/constant/constant.go && time make all-containers
...
make all-containers 0.93s user 1.01s system 2% cpu 1:28.55 total
```shell ❯ git reset --hard && git checkout upstream/main && export BUILDX_PLATFORMS=linux/arm64; make all-containers && echo "// test cache" >> pkg/constant/constant.go && time make all-containers HEAD is now at e46515963 Cache module dependencies between container builds HEAD is now at dacd5eff9 Merge pull request #8380 from sseago/worker-count [+] Building 70.9s (15/15) FINISHED kubernetes:crc => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 2.38kB 0.0s => [internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.2s => [internal] load metadata for docker.io/library/golang:1.22-bookworm 0.2s => [internal] load .dockerignore 0.0s => => transferring context: 60B 0.0s => CACHED [stage-2 1/3] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a6 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => [internal] load build context 0.3s => => transferring context: 1.44MB 0.3s => CACHED [restic-builder 1/3] FROM docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def654 0.0s => => resolve docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18b99b4 0.0s => [velero-builder 2/4] WORKDIR /go/src/github.com/vmware-tanzu/velero 2.7s => [restic-builder 2/3] COPY . /go/src/github.com/vmware-tanzu/velero 5.1s => [velero-builder 3/4] COPY . /go/src/github.com/vmware-tanzu/velero 4.5s => [restic-builder 3/3] RUN mkdir -p /output/usr/bin && export GOARM=$(echo "" | cut -c2-) && /go/src/github.com/vmware-tanzu 38.6s => [velero-builder 4/4] RUN mkdir -p /output/usr/bin && export GOARM=$( echo "" | cut -c2-) && go build -o /output/velero 59.7s => [stage-2 2/3] COPY --from=velero-builder /output / 0.2s => [stage-2 3/3] COPY --from=restic-builder /output / 0.1s => exporting to image 3.0s => => exporting layers 2.9s => => exporting manifest sha256:cc0bcc448812dc8cda723d577dbc4b0a7f1b0b2c959d11bf6138132d0aca781b 0.0s => => exporting config sha256:af7e3af8c54a3e2f29090bf0e18f50595cdd6c085e314f81bd0e207a97784bf5 0.0s => => exporting attestation manifest sha256:4dabab59e9a03035e65aec199abaf41388bafb8bf1e91492f488f9febb2caa76 0.0s => => exporting manifest list sha256:69c0f6643eb59d576739e3a27b09a972c4743020b8b4b2bc273d88a432e6a719 0.0s container: velero/velero:main [+] Building 8.5s (15/15) FINISHED kubernetes:crc => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 2.38kB 0.0s => [internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.2s => [internal] load metadata for docker.io/library/golang:1.22-bookworm 0.2s => [internal] load .dockerignore 0.0s => => transferring context: 60B 0.0s => CACHED [stage-2 1/3] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a6 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => [internal] load build context 0.3s => => transferring context: 543.35kB 0.3s => [restic-builder 1/3] FROM docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18 0.0s => => resolve docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18b99b4 0.0s => CACHED [restic-builder 2/3] COPY . /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [velero-builder 2/4] WORKDIR /go/src/github.com/vmware-tanzu/velero 0.0s => CACHED [velero-builder 3/4] COPY . /go/src/github.com/vmware-tanzu/velero 0.0s => [restic-builder 3/3] RUN mkdir -p /output/usr/bin && export GOARM=$(echo "" | cut -c2-) && /go/src/github.com/vmware-tanzu/ 2.2s => [velero-builder 4/4] RUN mkdir -p /output/usr/bin && export GOARM=$( echo "" | cut -c2-) && go build -o /output/velero-rest 6.8s => [stage-2 2/3] COPY --from=velero-builder /output / 0.1s => [stage-2 3/3] COPY --from=restic-builder /output / 0.1s => exporting to image 0.7s => => exporting layers 0.6s => => exporting manifest sha256:d4a247b9a394bbc7a9a811a0c09c979cb626df084b9a9f412d27af87c390ef3a 0.0s => => exporting config sha256:a78a5ad0417fd9393119e25fc7d0fadc9072a9ecfb670652c6b112a36c6eb459 0.0s => => exporting attestation manifest sha256:808c4106e969f75e9defc3e9e758539ea15273d65ae35f7c5823a1e531530916 0.0s => => exporting manifest list sha256:11501d2996a4fb0726d80a88943ee80fbffafeeb4ffcfbc4d4e1b21ba0d68485 0.0s container: velero/velero-restore-helper:main [+] Building 71.5s (15/15) FINISHED kubernetes:crc => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 2.38kB 0.0s => [internal] load metadata for docker.io/library/golang:1.22-bookworm 0.1s => [internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.1s => [internal] load .dockerignore 0.0s => => transferring context: 60B 0.0s => CACHED [stage-2 1/3] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a6 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => CACHED [restic-builder 1/3] FROM docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def654 0.0s => => resolve docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18b99b4 0.0s => [internal] load build context 0.2s => => transferring context: 544.33kB 0.2s => CACHED [velero-builder 2/4] WORKDIR /go/src/github.com/vmware-tanzu/velero 0.0s => [restic-builder 2/3] COPY . /go/src/github.com/vmware-tanzu/velero 3.5s => [velero-builder 3/4] COPY . /go/src/github.com/vmware-tanzu/velero 5.5s => [restic-builder 3/3] RUN mkdir -p /output/usr/bin && export GOARM=$(echo "" | cut -c2-) && /go/src/github.com/vmware-tanzu 45.2s => [velero-builder 4/4] RUN mkdir -p /output/usr/bin && export GOARM=$( echo "" | cut -c2-) && go build -o /output/velero 61.8s => [stage-2 2/3] COPY --from=velero-builder /output / 0.2s => [stage-2 3/3] COPY --from=restic-builder /output / 0.1s => exporting to image 3.0s => => exporting layers 2.9s => => exporting manifest sha256:e42bc864d6742dc5823df75c79d488f2fbe93ddac7425bf718e6876567b83024 0.0s => => exporting config sha256:a5a2d96b157fcdb1ad02d4011796e489428609560b1206b0e76fbb9792032547 0.0s => => exporting attestation manifest sha256:8dfc981ebcc11a3acc60251044f35757b5797870d9154656153de9d4d20869d4 0.0s => => exporting manifest list sha256:1be37e0ed679001fcbc553ba112865fba9cb42a6a523202f1066c3b2f7edd09f 0.0s container: velero/velero:main [+] Building 15.8s (17/17) FINISHED kubernetes:crc => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 2.38kB 0.0s => [internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:latest 0.3s => [internal] load metadata for docker.io/library/golang:1.22-bookworm 0.3s => [auth] library/golang:pull token for registry-1.docker.io 0.0s => [auth] paketobuildpacks/run-jammy-tiny:pull token for registry-1.docker.io 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 60B 0.0s => CACHED [stage-2 1/3] FROM docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a6 0.0s => => resolve docker.io/paketobuildpacks/run-jammy-tiny:latest@sha256:6a3b9424b0616c4c37309b3f3e410f305ad75c484ab74b0a624d22c8a33ae5ae 0.0s => CACHED [restic-builder 1/3] FROM docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def654 0.0s => => resolve docker.io/library/golang:1.22-bookworm@sha256:475ff60e52faaf037be2e7a1bc2ea5ea4aaa3396274af3def6545124a18b99b4 0.0s => [internal] load build context 0.2s => => transferring context: 561.69kB 0.2s => CACHED [velero-builder 2/4] WORKDIR /go/src/github.com/vmware-tanzu/velero 0.0s => [velero-builder 3/4] COPY . /go/src/github.com/vmware-tanzu/velero 2.2s => [restic-builder 2/3] COPY . /go/src/github.com/vmware-tanzu/velero 3.8s => [velero-builder 4/4] RUN mkdir -p /output/usr/bin && export GOARM=$( echo "" | cut -c2-) && go build -o /output/velero-res 11.7s => [restic-builder 3/3] RUN mkdir -p /output/usr/bin && export GOARM=$(echo "" | cut -c2-) && /go/src/github.com/vmware-tanzu/ 9.4s => [stage-2 2/3] COPY --from=velero-builder /output / 0.1s => [stage-2 3/3] COPY --from=restic-builder /output / 0.1s => exporting to image 0.7s => => exporting layers 0.6s => => exporting manifest sha256:added338a5b3f516ca59ff06a053c987abd11d5dfe44565385d6be94737cb591 0.0s => => exporting config sha256:f26c3643831e7df6379b746ee2429e6a8dcbdf3ec220e830e83999bfc329138c 0.0s => => exporting attestation manifest sha256:aaa90d2e1055a79d71d33c756e25f2bdddc493ab2ab7d56e901a8df1503ab326 0.0s => => exporting manifest list sha256:4f3bb657a22d2e90e497ec1ed917542b7c045d0d1fdde5f2bc577a247393f092 0.0s container: velero/velero-restore-helper:main make all-containers 0.93s user 1.01s system 2% cpu 1:28.55 total ```
Thank you for contributing to Velero!
Please add a summary of your change
Makes subsequent builds faster if only code change and no go.mod changes.
Does your change fix a particular issue?
Fixes #(issue)
Please indicate you've done the following:
make new-changelog
) or comment/kind changelog-not-required
on this PR.site/content/docs/main
.