Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitlab-runner on windows in docker fails to run with wrong OSType error

I have a gitlab-runner on a Windows Server with enabled Hyper-V.

With the docker API exposed to the network I'm able to run linux docker containers and even docker itself with docker:latest.

e:\>docker run -ti --rm -e DOCKER_HOST=tcp://10.99.0.12:2375 --name test docker:latest

/ # docker ps
CONTAINER ID ....
xxxxx docker:latest ... Up 10 seconds

/ # docker run -ti --rm busybox uname -a
Linux 42342423 4.14.35 ... 

So that seems to be all correct.

When I now want to run a docker-compose up -d in my deploy stage, I'll get an error from gitlab-runner

Running with gitlab-runner 12.10.0 (c553af1a)
   on Staging Runner
Preparing the "docker" executor
 ERROR: Removing network for build
 ERROR: Job failed: executor requires OSType=linux, but Docker Engine supports only OSType=windows

I maybe could run gitlab-runner directly on the host machine, but rather have everything in the repository and only need to have docker installed.

like image 259
Meiko Watu Avatar asked Dec 01 '25 03:12

Meiko Watu


2 Answers

I've run into this recently. You have to go into Docker on your Windows host and select the "Switch to Linux containers..." option.

Related:

  • Gitlab CI - ERROR: Job failed: executor requires OSType=linux, but Docker Engine supports only OSType=windows
like image 78
Aleksey Tsalolikhin Avatar answered Dec 04 '25 06:12

Aleksey Tsalolikhin


For everyone coming across this with the same problem.

Gitlab doesn't want to implement LCOW at the moment so it's not possible with docker-executor.

More info: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4373

like image 26
Meiko Watu Avatar answered Dec 04 '25 04:12

Meiko Watu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!