mirror of https://github.com/docker/cli.git
use uuid to invalidate cache
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
caa31d9374
commit
663f01b9cc
|
@ -90,16 +90,12 @@ target "update-vendor" {
|
||||||
output = ["."]
|
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" {
|
target "mod-outdated" {
|
||||||
dockerfile = "./dockerfiles/Dockerfile.vendor"
|
dockerfile = "./dockerfiles/Dockerfile.vendor"
|
||||||
target = "outdated"
|
target = "outdated"
|
||||||
args = {
|
args = {
|
||||||
TIMESTAMP = TIMESTAMP
|
// used to invalidate cache (more info https://github.com/moby/buildkit/issues/1213)
|
||||||
|
UUID = uuidv4()
|
||||||
}
|
}
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ ifeq ($(DOCKER_CLI_GO_BUILD_CACHE),y)
|
||||||
DOCKER_CLI_MOUNTS += -v "$(CACHE_VOLUME_NAME):/root/.cache/go-build"
|
DOCKER_CLI_MOUNTS += -v "$(CACHE_VOLUME_NAME):/root/.cache/go-build"
|
||||||
endif
|
endif
|
||||||
VERSION = $(shell cat VERSION)
|
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)
|
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
|
# Some Dockerfiles use features that are only supported with BuildKit enabled
|
||||||
|
@ -94,7 +93,7 @@ validate-vendor: ## validate vendor
|
||||||
|
|
||||||
.PHONY: mod-outdated
|
.PHONY: mod-outdated
|
||||||
mod-outdated: ## check outdated dependencies
|
mod-outdated: ## check outdated dependencies
|
||||||
TIMESTAMP=$(TIMESTAMP) docker buildx bake mod-outdated
|
docker buildx bake mod-outdated
|
||||||
|
|
||||||
.PHONY: authors
|
.PHONY: authors
|
||||||
authors: ## generate AUTHORS file from git history
|
authors: ## generate AUTHORS file from git history
|
||||||
|
|
|
@ -34,7 +34,7 @@ EOT
|
||||||
|
|
||||||
FROM psampaz/go-mod-outdated:${MODOUTDATED_VERSION} AS go-mod-outdated
|
FROM psampaz/go-mod-outdated:${MODOUTDATED_VERSION} AS go-mod-outdated
|
||||||
FROM base AS outdated
|
FROM base AS outdated
|
||||||
ARG TIMESTAMP
|
ARG UUID
|
||||||
RUN --mount=target=.,rw \
|
RUN --mount=target=.,rw \
|
||||||
--mount=target=/go/pkg/mod,type=cache \
|
--mount=target=/go/pkg/mod,type=cache \
|
||||||
--mount=from=go-mod-outdated,source=/home/go-mod-outdated,target=/usr/bin/go-mod-outdated \
|
--mount=from=go-mod-outdated,source=/home/go-mod-outdated,target=/usr/bin/go-mod-outdated \
|
||||||
|
|
Loading…
Reference in New Issue