From e8c5df0ad943cf2ab1c657165900928c3f6f7d3b Mon Sep 17 00:00:00 2001 From: Mark Hansen Date: Sun, 28 Feb 2021 17:43:51 +1100 Subject: [PATCH] Build docker images with buildkit Buildkit is the newer, faster way to build docker images. For one, buildkit doesn't send the entire repo as build context. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 667977190..8716ebab0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -715,8 +715,8 @@ deployment: # fetches the :latest image (not failing if image is not found) for caching - docker pull $CI_REGISTRY_IMAGE/$IMAGE:latest || true # Build and push with git commit SHA tag, reusing layers from the :latest image if possible - - docker build -t $CI_REGISTRY_IMAGE/$IMAGE:$CI_COMMIT_SHA --cache-from $CI_REGISTRY_IMAGE/$IMAGE:latest -f ci/$IMAGE/Dockerfile . - - docker push $CI_REGISTRY_IMAGE/$IMAGE:$CI_COMMIT_SHA + - DOCKER_BUILDKIT=1 docker build -t $CI_REGISTRY_IMAGE/$IMAGE:$CI_COMMIT_SHA --cache-from $CI_REGISTRY_IMAGE/$IMAGE:latest -f ci/$IMAGE/Dockerfile --build-arg BUILDKIT_INLINE_CACHE=1 . + - docker push $CI_REGISTRY_IMAGE/$IMAGE:$CI_COMMIT_SHA .docker_push_template: &docker_push_definition <<: *docker_definition -- 2.40.0