From b5662bdc7aac2c5b17940f1fed9a325787ce1fcc Mon Sep 17 00:00:00 2001 From: Anthony Lukach Date: Fri, 20 Dec 2024 11:49:18 -0800 Subject: [PATCH] Experiment: use GHA cache for docker builds [fix] --- images/cloud_run_images.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/images/cloud_run_images.py b/images/cloud_run_images.py index 031e8484..85de1504 100644 --- a/images/cloud_run_images.py +++ b/images/cloud_run_images.py @@ -65,8 +65,11 @@ def construct_name(resource_name: str) -> str: build=docker.DockerBuildArgs( context="../", dockerfile="../Dockerfiles/Dockerfile.cloud_run_offset", - cache_from={"type": "gha"}, - cache_to={"type": "gha", "mode": "max"}, + extra_options=[ + '--output=type=docker', + '--cache-from=type=local,src=/tmp/.buildx-cache', + '--cache-to=type=local,dest=/tmp/.buildx-cache' + ] target="final", ), image_name=cloud_run_offset_tile_image_url, @@ -77,8 +80,11 @@ def construct_name(resource_name: str) -> str: build=docker.DockerBuildArgs( context="../", dockerfile="../Dockerfiles/Dockerfile.cloud_run_orchestrator", - cache_from={"type": "gha"}, - cache_to={"type": "gha", "mode": "max"}, + extra_options=[ + '--output=type=docker', + '--cache-from=type=local,src=/tmp/.buildx-cache', + '--cache-to=type=local,dest=/tmp/.buildx-cache' + ] target="final", ), image_name=cloud_run_orchestrator_image_url, @@ -89,8 +95,11 @@ def construct_name(resource_name: str) -> str: build=docker.DockerBuildArgs( context="../", dockerfile="../Dockerfiles/Dockerfile.cloud_run_tipg", - cache_from={"type": "gha"}, - cache_to={"type": "gha", "mode": "max"}, + extra_options=[ + '--output=type=docker', + '--cache-from=type=local,src=/tmp/.buildx-cache', + '--cache-to=type=local,dest=/tmp/.buildx-cache' + ] target="final", ), image_name=cloud_run_tipg_image_url,