diff --git a/docker-bake.hcl b/docker-bake.hcl index 76003cf185..731ed0cc64 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -90,16 +90,12 @@ target "update-vendor" { output = ["."] } -// Used to invalidate cache for mod-outdated run stage -// See also https://github.com/moby/buildkit/issues/1213 -variable "TIMESTAMP" { - default = "" -} target "mod-outdated" { dockerfile = "./dockerfiles/Dockerfile.vendor" target = "outdated" args = { - TIMESTAMP = TIMESTAMP + // used to invalidate cache (more info https://github.com/moby/buildkit/issues/1213) + UUID = uuidv4() } output = ["type=cacheonly"] } diff --git a/docker.Makefile b/docker.Makefile index 3b4888275e..18f3159973 100644 --- a/docker.Makefile +++ b/docker.Makefile @@ -20,7 +20,6 @@ ifeq ($(DOCKER_CLI_GO_BUILD_CACHE),y) DOCKER_CLI_MOUNTS += -v "$(CACHE_VOLUME_NAME):/root/.cache/go-build" endif VERSION = $(shell cat VERSION) -TIMESTAMP = $(shell date '+%s') ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT -e PLATFORM -e TESTFLAGS -e TESTDIRS -e GOOS -e GOARCH -e GOARM -e TEST_ENGINE_VERSION=$(E2E_ENGINE_VERSION) # Some Dockerfiles use features that are only supported with BuildKit enabled @@ -94,7 +93,7 @@ validate-vendor: ## validate vendor .PHONY: mod-outdated mod-outdated: ## check outdated dependencies - TIMESTAMP=$(TIMESTAMP) docker buildx bake mod-outdated + docker buildx bake mod-outdated .PHONY: authors authors: ## generate AUTHORS file from git history diff --git a/dockerfiles/Dockerfile.vendor b/dockerfiles/Dockerfile.vendor index 2f242fba60..237cb5100c 100644 --- a/dockerfiles/Dockerfile.vendor +++ b/dockerfiles/Dockerfile.vendor @@ -34,7 +34,7 @@ EOT FROM psampaz/go-mod-outdated:${MODOUTDATED_VERSION} AS go-mod-outdated FROM base AS outdated -ARG TIMESTAMP +ARG UUID RUN --mount=target=.,rw \ --mount=target=/go/pkg/mod,type=cache \ --mount=from=go-mod-outdated,source=/home/go-mod-outdated,target=/usr/bin/go-mod-outdated \