Skip to content

Commit

Permalink
Improve buildx cache usage
Browse files Browse the repository at this point in the history
  • Loading branch information
silkeh committed Dec 30, 2022
1 parent db0c82d commit a1590c6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions templates/gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,26 @@
.docker-buildx:
extends: .docker
image: jdrouet/docker-with-buildx:stable
cache:
key: buildx-$IMAGE_TAG
paths: [.buildx-cache]
script:
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker buildx create --driver=docker-container --use
- docker buildx build . --target=test
- docker buildx build .
--pull
--target=test
--cache-from type=local,src=.buildx-cache
--cache-to type=local,dest=.buildx-cache
--file dockerfiles/$IMAGE_TAG.Dockerfile
--platform $PLATFORMS
- docker buildx build . --target=final --push
- docker buildx build . --target=final
--pull
--push
--tag $CI_REGISTRY_IMAGE:$IMAGE_TAG
--cache-from type=local,src=.buildx-cache
--file dockerfiles/$IMAGE_TAG.Dockerfile
--platform $PLATFORMS
cache:
key: buildx
paths: [.buildx-cache]

.alias:
stage: build
Expand Down

0 comments on commit a1590c6

Please sign in to comment.