feat(ci): migrate to buildah

This commit is contained in:
Simon Cornet 2025-06-10 16:22:01 +02:00
commit 8ccd5dc3ec

View file

@ -1,32 +1,26 @@
--- ---
variables: variables:
DOCKER_DRIVER: "overlay2" STORAGE_DRIVER: "overlay"
DOCKER_HOST: "tcp://localhost:2375/"
DOCKER_TLS_CERTDIR: ""
stages: stages:
- "build" - "build"
image-build: image-build:
stage: "image-build" stage: "image-build"
image: "docker:28.2.2" image: "quay.io/buildah/stable:latest"
services:
- name: "docker:28.2.2-dind"
command: ["--tls=false"]
script: script:
# login to container registry # Login to container registry
- "echo $CR_PASSWORD | docker login $CR_HOSTNAME -u $CR_USERNAME --password-stdin" - echo $CR_PASSWORD | buildah login -u $CR_USERNAME --password-stdin $CR_HOSTNAME
# build docs-simoncor-net image # Build image using buildah (rootless)
- "docker build -t docs-simoncor-net ." - buildah bud -t docs-simoncor-net .
# add tags to image # Tag the image for registry
- "docker image tag docs-simoncor-net cr.simoncor.net/siempie/docs-simoncor-net:latest" - buildah tag docs-simoncor-net cr.simoncor.net/siempie/docs-simoncor-net:latest
# push image to dockerhub. # Push the image
- "docker push --all-tags cr.simoncor.net/siempie/docs-simoncor-net" - buildah push cr.simoncor.net/siempie/docs-simoncor-net:latest
# logout from container registry # Logout
- "docker logout $CR_HOSTNAME" - buildah logout $CR_HOSTNAME