Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

Commit

Permalink
feat(build): pull images before rebuilding to leverage layer cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Dec 23, 2019
1 parent 193cf27 commit c435514
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ IMAGE_TAG="$(echo "${CI_COMMIT_TAG:-${CI_COMMIT_REF_SLUG}}" | sed -r 's/[^-_a-zA
IMAGE_SHORT="${IMAGE_NAME}:${IMAGE_TAG}"
IMAGE_FULL="${IMAGE_NAME}:${IMAGE_TAG}-${IMAGE_ARCH}"

echo "Building image: ${IMAGE_FULL}"
echo "Pulling existing image: ${IMAGE_FULL}"
docker pull ${IMAGE_FULL}

echo "Building image: ${IMAGE_FULL}"
docker build ${IMAGE_ARGS} -f "docker/Dockerfile.${IMAGE_ARCH}" -t "${IMAGE_FULL}" .

if [[ "${IMAGE_PUSH}" == "--push" ]];
Expand Down

0 comments on commit c435514

Please sign in to comment.