Skip to content

Commit 663f01b

Browse files
committed
use uuid to invalidate cache
Signed-off-by: CrazyMax <[email protected]>
1 parent caa31d9 commit 663f01b

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

docker-bake.hcl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,12 @@ target "update-vendor" {
9090
output = ["."]
9191
}
9292

93-
// Used to invalidate cache for mod-outdated run stage
94-
// See also https://github.com/moby/buildkit/issues/1213
95-
variable "TIMESTAMP" {
96-
default = ""
97-
}
9893
target "mod-outdated" {
9994
dockerfile = "./dockerfiles/Dockerfile.vendor"
10095
target = "outdated"
10196
args = {
102-
TIMESTAMP = TIMESTAMP
97+
// used to invalidate cache (more info https://github.com/moby/buildkit/issues/1213)
98+
UUID = uuidv4()
10399
}
104100
output = ["type=cacheonly"]
105101
}

docker.Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ ifeq ($(DOCKER_CLI_GO_BUILD_CACHE),y)
2020
DOCKER_CLI_MOUNTS += -v "$(CACHE_VOLUME_NAME):/root/.cache/go-build"
2121
endif
2222
VERSION = $(shell cat VERSION)
23-
TIMESTAMP = $(shell date '+%s')
2423
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)
2524

2625
# Some Dockerfiles use features that are only supported with BuildKit enabled
@@ -94,7 +93,7 @@ validate-vendor: ## validate vendor
9493

9594
.PHONY: mod-outdated
9695
mod-outdated: ## check outdated dependencies
97-
TIMESTAMP=$(TIMESTAMP) docker buildx bake mod-outdated
96+
docker buildx bake mod-outdated
9897

9998
.PHONY: authors
10099
authors: ## generate AUTHORS file from git history

dockerfiles/Dockerfile.vendor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ EOT
3434

3535
FROM psampaz/go-mod-outdated:${MODOUTDATED_VERSION} AS go-mod-outdated
3636
FROM base AS outdated
37-
ARG TIMESTAMP
37+
ARG UUID
3838
RUN --mount=target=.,rw \
3939
--mount=target=/go/pkg/mod,type=cache \
4040
--mount=from=go-mod-outdated,source=/home/go-mod-outdated,target=/usr/bin/go-mod-outdated \

0 commit comments

Comments
 (0)