]> granicus.if.org Git - graphviz/commitdiff
Revert "Revert "Build docker images with buildkit""
authorMark Hansen <markhansen@google.com>
Thu, 4 Mar 2021 10:06:56 +0000 (21:06 +1100)
committerMark Hansen <markhansen@google.com>
Thu, 4 Mar 2021 10:06:56 +0000 (21:06 +1100)
This reverts commit 6cdd95b8776d54eb1a474e1d90f7f3b7e85a7e01.

I'm now confident I can make Docker buildkit caching work after
observing it work on graphviz.gitlab.io. repo.

I now understand why I wasn't seeing caching before:
- I was pushing to my own fork of graphviz
- I didn't push to the master branch
- So I didn't build a `live` tag
- So I didn't have anything to cache from

.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