I am trying to build windows container using https://gitlab.com, but I didnot find if this is supported or not.
I made a test with a really simple Dockerfile:
FROM mcr.microsoft.com/windows/servercore:ltsc2019
CMD echo "Hello World from Windows"
Using .gitlab-ci.yml
image: docker
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
windows:
stage: build
script:
- docker build -t ${CI_REGISTRY}/${CI_PROJECT_PATH}:${CI_COMMIT_REF_SLUG} .
- docker push ${CI_REGISTRY}/${CI_PROJECT_PATH}:${CI_COMMIT_REF_SLUG}
It fails with :
image operating system "windows" cannot be used on this platform
ERROR: Job failed: exit code 1
Looking for the documentation of gitlab-runner, it seems supported https://docs.gitlab.com/runner/executors/#selecting-the-executor.
Is there a way to build a windows container from the online service ?