Docker:
  image: gitlab.jonasled.de/jonasled/buildx-docker:latest
  stage: build
  services:
    - docker:dind
  before_script:
    - docker context create build
    - docker buildx create build --use
    - docker run --privileged --rm tonistiigi/binfmt --install all
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - |
      if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
        tag="latest"
      else
        tag="$CI_COMMIT_REF_SLUG"
      fi
    - docker buildx build --platform linux/arm64,linux/amd64 --push --provenance false --tag "$CI_REGISTRY_IMAGE:${tag}" .