Building darwin container imagein CI/CD

Problem to solve

I want to build windows/macos docker container images, what would be the easiest way to do it ?

I already have buildx multiarch images setup done via qemu, hower among available platforms I do not see widows/darwin, so I wonder what wold be easiet way to go:

  1. Try to build windows/darwin on linux - I googled up a bit but nothing found
  2. Setup docker on windows/macos runners (gitlab.com saas) - any examples ? Does it differ from setting it up on linux runners

Steps to reproduce

Which troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

I looked over google and gitlab documentation.

Versions

Please select whether options apply, and add the version information.

  • Self-managed
  • GitLab.com SaaS
  • Self-hosted Runners

Versions

Helpful resources

My setup for multiarch on linux

release:
  stage: release
  image: docker:25.0.4-cli-alpine3.19
  services:
    - docker:dind
  only:
    - main
  variables:
    DOCKER_REGISTRY: $CI_REGISTRY
    DOCKER_USERNAME: $CI_REGISTRY_USER
    DOCKER_PASSWORD: $CI_REGISTRY_PASSWORD
    DOCKER_TLS_CERTDIR: "/certs"
    GIT_STRATEGY: clone
  before_script:
    - apk add --no-cache curl go make bash git
    - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
    - docker context create tls
    - docker context use tls
    - echo $CI_REGISTRY_PASSWORD | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
    - docker buildx create --name multiarch --use tls
    - docker buildx inspect --bootstrap
  script:
    - curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ./bin/semantic-release && chmod +x ./bin/semantic-release
    - ./bin/semantic-release --hooks goreleaser
    - echo $"failure"