From 3f1bc0e1b0fe64cc34d911a70e37fb3b4ac9e874 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sat, 21 Jan 2023 17:18:46 -0600 Subject: [PATCH] fix(build): use cached docker images to avoid rebuilding layers --- common/scripts/image-build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/scripts/image-build.sh b/common/scripts/image-build.sh index 8e164410..88dd1b17 100755 --- a/common/scripts/image-build.sh +++ b/common/scripts/image-build.sh @@ -13,7 +13,10 @@ docker pull "${IMAGE_FULL}" || echo "Failed to load last image." echo "Building image: ${IMAGE_FULL}" -docker build -f "${IMAGE_FILE}" -t "${IMAGE_FULL}" . || { echo "Failed to build image!"; exit 1; } +docker build \ + --cache-from "${IMAGE_FULL}" \ + -f "${IMAGE_FILE}" \ + -t "${IMAGE_FULL}" . || { echo "Failed to build image!"; exit 1; } if [[ "${IMAGE_PUSH}" == "--push" ]]; then