Skip to content

Commit

Permalink
fix(build): use cached docker images to avoid rebuilding layers
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 21, 2023
1 parent 505cacf commit 3f1bc0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/scripts/image-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f1bc0e

Please sign in to comment.