Gitlab CI-错误:作业失败:执行程序需要OSType = linux,但是Docker Engine仅支持OSType = windows [英] Gitlab CI - ERROR: Job failed: executor requires OSType=linux, but Docker Engine supports only OSType=windows

查看:204
本文介绍了Gitlab CI-错误:作业失败:执行程序需要OSType = linux,但是Docker Engine仅支持OSType = windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行Gitlab CI管道时遇到此错误。据我了解,错误表明我正在尝试在Windows docker-engine上运行Linux类型的docker映像?但问题是我正在使用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?


错误:作业失败:执行程序需要OSType = linux,但Docker Engine仅支持OSType = windows

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

我的CI:

image: hello-world:nanoserver

stages:
  - build

build1:
  stage: build
  script:
    - echo "Hello world"


推荐答案



共享标签和简单标签有什么区别?

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

某些图像已将简单标签分开和共享标签部分中的支持的标签和相应的Dockerfile链接下的
(有关示例,请参见mongo
图像)。

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

简单标签是单个 Linux或Windows映像的实例。
通常是清单清单,其中可以包含为
其他体系结构构建的同一映像;例如,mongo:4.0-xenial当前具有用于amd64和arm64v8的
映像。 Docker守护程序负责
选择适合主机体系结构的映像。

"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.

共享标签是始终指向清单列表的标签,其中
包含Windows
和Linux映像的潜在多个版本的组合,这些版本包含所有各自映像的体系结构-在mongo示例中
,4.0标记是一个共享标记,由(
撰写本文时)所有4.0-xenial,
4.0-windowsservercore-ltsc2016、4.0-windowsservercore-1709和4.0-windowsservercore-1803。

"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.

简单标签使docker运行mongo:4.0-xenial可以跨平台在单个平台上进行正确的
事情(Linux在
mongo:4.0-xenial的情况下)。 共享标签使docker运行mongo:4.0到
大致可在Linux和受支持的
Windows的许多不同版本(例如Windows Server Core LTSC 2016,
)上运行。 Docker守护程序再次负责根据主机平台和版本确定
适当的映像。)

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).

您可以尝试共享标签:

image: hello-world

最新 c标签具有:

linux/386

windows v10.0.17134.1069/amd64

windows v10.0.17763.802/amd64

,而Docker将为您选择合适的

and Docker will pick up the right one for you

来自此处,您需要执行者 docker-windows 运行 Windows容器

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

,因此您可以添加 executor = docker-windows 到您的跑步者配置

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

这篇关于Gitlab CI-错误:作业失败:执行程序需要OSType = linux,但是Docker Engine仅支持OSType = windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆