From 4c1af406f734afc50a7a0e199af95231a61e8b33 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Mon, 5 Dec 2022 08:17:44 -0500 Subject: [PATCH] Cache prior build layers for ~5 days This vastly improves build performance at the cost of some extra registry server storage (which there is plenty of). Note: The cache TTL needs to be coordinated with the registry server's tag-cleanup policy. Signed-off-by: Chris Evich --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2d1cb20..cb87d73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,6 +47,8 @@ build: echo "Building/Pushing to: ${CI_REGISTRY_IMAGE}:${IMAGE_TAG}"; - >- buildah build \ + --layers --cache-from "${CI_REGISTRY_IMAGE}" \ + --cache-to "${CI_REGISTRY_IMAGE}" --cache-ttl=128h \ --label "org.opencontainers.image.source=${CI_PROJECT_URL}" \ --label "org.opencontainers.image.revision=$CI_COMMIT_SHA" \ --label "org.opencontainers.image.created=$CI_JOB_STARTED_AT" \