Commit ca1c0e88 authored by Simon Cornet's avatar Simon Cornet
Browse files

feat: migrate to buildah

parent 667ab9b9
Loading
Loading
Loading
Loading
Loading
+12 −15
Original line number Diff line number Diff line
---

variables:
  DOCKER_DRIVER: "overlay2"
  DOCKER_HOST: "tcp://localhost:2375/"
  DOCKER_TLS_CERTDIR: ""
  STORAGE_DRIVER: "overlay"

build-image:
  stage: "build"
  image: "docker:28.2.2"
  services:
    - name: "docker:28.2.2-dind"
      command: ["--tls=false"]
stages:
  - "build"

image-build:
  stage: "image-build"
  image: "quay.io/buildah/stable:latest"
  script:

    # 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 observium-pe image
    - "docker build -t roundcube -f Dockerfile.linux.amd64 ."
    # build image
    - "buildah bud -t roundcube -f Dockerfile.linux.amd64 ."

    # add tags to image
    - "docker image tag roundcube cr.simoncor.net/siempie/roundcube:latest"
    - "buildah tag roundcube cr.simoncor.net/siempie/roundcube:latest"

    # push image to dockerhub.
    - "docker push --all-tags cr.simoncor.net/siempie/roundcube"
    - "buildah push cr.simoncor.net/siempie/roundcube:latest"

    # logout from container registry
    - "docker logout $CR_HOSTNAME"
    - "buildah logout $CR_HOSTNAME"