Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab CI - ERROR: Job failed: executor requires OSType=linux, but Docker Engine supports only OSType=windows

Getting this error while running Gitlab CI pipeline. As I understand the error says that I'm trying to run a Linux type docker image on a windows docker-engine? But the thing is I'm using a windows docker image. What could be the problem?

ERROR: Job failed: executor requires OSType=linux, but Docker Engine supports only OSType=windows

My CI:

image: hello-world:nanoserver

stages:
  - build

build1:
  stage: build
  script:
    - echo "Hello world"
like image 325
user1985273 Avatar asked Nov 08 '19 15:11

user1985273


1 Answers

What's the difference between "Shared" and "Simple" tags?

Some images have separated "Simple Tags" and "Shared Tags" sections under "Supported tags and respective Dockerfile links" (see the mongo image for an example).

"Simple Tags" are instances of a "single" Linux or Windows image. It is often a manifest list that can include the same image built for other architectures; for example, mongo:4.0-xenial currently has images for amd64 and arm64v8. The Docker daemon is responsible for picking the appropriate image for the host architecture.

"Shared Tags" are tags that always point to a manifest list which includes some combination of potentially multiple versions of Windows and Linux images across all their respective images' architectures -- in the mongo example, the 4.0 tag is a shared tag consisting of (at the time of this writing) all of 4.0-xenial, 4.0-windowsservercore-ltsc2016, 4.0-windowsservercore-1709, and 4.0-windowsservercore-1803.

The "Simple Tags" enable docker run mongo:4.0-xenial to "do the right thing" across architectures on a single platform (Linux in the case of mongo:4.0-xenial). The "Shared Tags" enable docker run mongo:4.0 to roughly work on both Linux and as many of the various versions of Windows that are supported (such as Windows Server Core LTSC 2016, where the Docker daemon is again responsible for determining the appropriate image based on the host platform and version).

I suggest you to try shared tags:

image: hello-world

the latest tag has:

linux/386

windows v10.0.17134.1069/amd64

windows v10.0.17763.802/amd64

and Docker will pick up the right one for you

From here you need the executer docker-windows to run Windows Container

so you may add executor = "docker-windows" to your runners config

like image 132
LinPy Avatar answered Nov 15 '22 08:11

LinPy