]> granicus.if.org Git - graphviz/commitdiff
Build docker images with buildkit
authorMark Hansen <markhansen@google.com>
Sun, 28 Feb 2021 06:43:51 +0000 (17:43 +1100)
committerMark Hansen <markhansen@google.com>
Sun, 28 Feb 2021 06:55:48 +0000 (17:55 +1100)
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

index 667977190ea115a633fcb0071fcd30c68350920e..8716ebab08099580bda2114ba8b3ed06bce2c097 100644 (file)
@@ -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