From 08bb626304c4a3c20efdf5488f11bb0a0503a234 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 10 Mar 2022 02:11:12 +0100 Subject: [PATCH] chore: use no-cache-filter for outdated stage Signed-off-by: CrazyMax --- .github/workflows/build.yml | 3 +++ .github/workflows/e2e.yml | 5 +++++ .github/workflows/validate.yml | 10 ++++++++++ docker-bake.hcl | 6 +----- hack/dockerfiles/vendor.Dockerfile | 1 - 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35905796..38790eed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,8 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + with: + version: latest - name: Test run: | @@ -102,6 +104,7 @@ jobs: name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 with: + version: latest driver-opts: image=moby/buildkit:master buildkitd-flags: --debug - diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 41c8dfa4..c1c8b83b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -51,6 +51,11 @@ jobs: name: Set up QEMU uses: docker/setup-qemu-action@v1 if: matrix.driver == 'docker' || matrix.driver == 'docker-container' + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + version: latest - name: Install buildx run: | diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f28f8aaa..64862b78 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -27,6 +27,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + version: latest - name: Run run: | @@ -40,6 +45,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + version: latest - name: Run run: | diff --git a/docker-bake.hcl b/docker-bake.hcl index 036683f1..3d07c460 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -89,11 +89,7 @@ target "mod-outdated" { inherits = ["_common"] dockerfile = "./hack/dockerfiles/vendor.Dockerfile" target = "outdated" - args = { - // used to invalidate cache for outdated run stage - // can be dropped when https://github.com/moby/buildkit/issues/1213 fixed - _RANDOM = uuidv4() - } + no-cache-filter = ["outdated"] output = ["type=cacheonly"] } diff --git a/hack/dockerfiles/vendor.Dockerfile b/hack/dockerfiles/vendor.Dockerfile index 73b53cb0..8620f276 100644 --- a/hack/dockerfiles/vendor.Dockerfile +++ b/hack/dockerfiles/vendor.Dockerfile @@ -39,7 +39,6 @@ EOT FROM psampaz/go-mod-outdated:${MODOUTDATED_VERSION} AS go-mod-outdated FROM base AS outdated -ARG _RANDOM RUN --mount=target=.,ro \ --mount=target=/go/pkg/mod,type=cache \ --mount=from=go-mod-outdated,source=/home/go-mod-outdated,target=/usr/bin/go-mod-outdated \