Skip to content

Commit 07bfbe6

Browse files
committed
ci: docker cache in a separate image
1 parent b2efcb0 commit 07bfbe6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ buildcontainer-% publishcontainer-%:
4343
@export DOCKER_BUILD_ARG="$(DOCKER_BUILD_ARG) $(if $(findstring publishcontainer,$@),--push,--load) $(if $(filter false,$(CACHE)),--no-cache,)"; \
4444
docker buildx build \
4545
$${DOCKER_BUILD_ARG} \
46-
--cache-from $(IMAGE_NAME):$*-$(GIT_BRANCH_NAME) \
47-
--cache-from $(IMAGE_NAME):$*-main \
48-
-t $(IMAGE_NAME):$*-$(PROJECT_VERSION) \
49-
-t $(IMAGE_NAME):$*-$(GIT_BRANCH_NAME) \
46+
--export-cache type=registry,ref=$(IMAGE_NAME):$*-cache-$(GIT_BRANCH_NAME) \
47+
--cache-from $(IMAGE_NAME):$*-cache-$(GIT_BRANCH_NAME) \
48+
--cache-from $(IMAGE_NAME):$*-cache-main \
49+
-t $(IMAGE_NAME):$*-$(PROJECT_VERSION)
5050
-f Dockerfile \
5151
--target $* \
5252
. ;

0 commit comments

Comments
 (0)