From 8ccd5dc3ecd80e8d6d6cd4c410dfd605b85849e8 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Tue, 10 Jun 2025 16:22:01 +0200 Subject: [PATCH] feat(ci): migrate to buildah --- .gitlab/image-build.yaml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.gitlab/image-build.yaml b/.gitlab/image-build.yaml index ff436d5..259910b 100644 --- a/.gitlab/image-build.yaml +++ b/.gitlab/image-build.yaml @@ -1,32 +1,26 @@ --- - variables: - DOCKER_DRIVER: "overlay2" - DOCKER_HOST: "tcp://localhost:2375/" - DOCKER_TLS_CERTDIR: "" + STORAGE_DRIVER: "overlay" stages: - "build" image-build: stage: "image-build" - image: "docker:28.2.2" - services: - - name: "docker:28.2.2-dind" - command: ["--tls=false"] + image: "quay.io/buildah/stable:latest" script: - # login to container registry - - "echo $CR_PASSWORD | docker login $CR_HOSTNAME -u $CR_USERNAME --password-stdin" + # Login to container registry + - echo $CR_PASSWORD | buildah login -u $CR_USERNAME --password-stdin $CR_HOSTNAME - # build docs-simoncor-net image - - "docker build -t docs-simoncor-net ." + # Build image using buildah (rootless) + - buildah bud -t docs-simoncor-net . - # add tags to image - - "docker image tag docs-simoncor-net cr.simoncor.net/siempie/docs-simoncor-net:latest" + # Tag the image for registry + - buildah tag docs-simoncor-net cr.simoncor.net/siempie/docs-simoncor-net:latest - # push image to dockerhub. - - "docker push --all-tags cr.simoncor.net/siempie/docs-simoncor-net" + # Push the image + - buildah push cr.simoncor.net/siempie/docs-simoncor-net:latest - # logout from container registry - - "docker logout $CR_HOSTNAME" + # Logout + - buildah logout $CR_HOSTNAME