From b0e45c1605c6a48ce4f525846fd641d7ea8b75c2 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Tue, 21 Feb 2023 09:07:08 +0000 Subject: [PATCH] Merge pull request #11908 from overleaf/jpa-fix-build-cache [misc] fix building docker image with cache when using docker version 23+ GitOrigin-RevId: 3df64bfc888b324b255af4c3f3b3abd178504a33 --- services/clsi/Makefile | 1 + services/filestore/Makefile | 1 + services/spelling/Makefile | 1 + services/web/Makefile | 5 +---- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/clsi/Makefile b/services/clsi/Makefile index aaccd65cbf..3be1f25fc6 100644 --- a/services/clsi/Makefile +++ b/services/clsi/Makefile @@ -92,6 +92,7 @@ build: || echo 'nothing cached' docker build \ --pull \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ --tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \ --cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \ --cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):main-deps \ diff --git a/services/filestore/Makefile b/services/filestore/Makefile index bfa367da84..2d588e62de 100644 --- a/services/filestore/Makefile +++ b/services/filestore/Makefile @@ -92,6 +92,7 @@ build: || echo 'nothing cached' docker build \ --pull \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ --tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \ --cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \ --cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):main-deps \ diff --git a/services/spelling/Makefile b/services/spelling/Makefile index cbd35530cd..d96b1f1665 100644 --- a/services/spelling/Makefile +++ b/services/spelling/Makefile @@ -92,6 +92,7 @@ build: || echo 'nothing cached' docker build \ --pull \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ --tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \ --cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \ --cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):main-deps \ diff --git a/services/web/Makefile b/services/web/Makefile index ba8b23a559..5cd642efcb 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -474,16 +474,15 @@ IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) IMAGE_REPO ?= gcr.io/overleaf-ops/$(PROJECT_NAME) IMAGE_REPO_BRANCH ?= $(IMAGE_REPO):$(BRANCH_NAME) IMAGE_REPO_MAIN ?= $(IMAGE_REPO):main -IMAGE_REPO_MASTER ?= $(IMAGE_REPO):master IMAGE_REPO_FINAL ?= $(IMAGE_REPO_BRANCH)-$(BUILD_NUMBER) export SENTRY_RELEASE ?= ${COMMIT_SHA} build_deps: docker build --pull \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ --cache-from $(IMAGE_REPO_BRANCH)-deps \ --cache-from $(IMAGE_REPO_MAIN)-deps \ - --cache-from $(IMAGE_REPO_MASTER)-deps \ --tag $(IMAGE_REPO_BRANCH)-deps \ --target deps \ --file Dockerfile \ @@ -492,8 +491,6 @@ build_deps: build_dev: docker build \ --build-arg SENTRY_RELEASE \ - --cache-from $(IMAGE_REPO_BRANCH)-deps \ - --cache-from $(IMAGE_CI)-dev \ --tag $(IMAGE_CI) \ --tag $(IMAGE_CI)-dev \ --target dev \