From 96dc278bea01b3b1d66c60038a56faa38b7894b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20=C3=81lvaro?= Date: Sat, 16 May 2020 18:10:49 +0200 Subject: [PATCH] feat: Use previous image as Docker cache --- hooks/build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hooks/build b/hooks/build index 4fbe91e..b984052 100644 --- a/hooks/build +++ b/hooks/build @@ -3,7 +3,10 @@ # Docker Daemon Build Hook # $IMAGE_NAME var is injected into the build so the tag is correct. +docker pull ${DOCKER_REPO}:latest + docker build \ + --cache-from=${DOCKER_REPO}:latest \ --build-arg=BUILD_DATE="$(date +"%Y-%m-%d %H:%M:%S%:z")" \ --build-arg=VCS_REF="$(git rev-parse --short HEAD)" \ -t ${IMAGE_NAME} .