Docker 图片无法在 GitLab 中使用:清单列表条目中 linux/amd64 没有匹配的清单

Docker image cannot used in GitLab : no matching manifest for linux/amd64 in the manifest list entries

我正在尝试在 GitLab 中创建 CICD 管道,并找到一个我认为可能适用于我的 .Net Framework 项目的图像,但是当我使用这个图像时,出现错误:

WARNING: Failed to pull image with policy "always": no matching manifest for linux/amd64 in the manifest list entries (manager.go:214:0s)
ERROR: Job failed: failed to pull image "mcr.microsoft.com/dotnet/framework/aspnet" with specified policies [always]: no matching manifest for linux/amd64 in the manifest list entries (manager.go:214:0s)

我的 yaml:

stages:
  - build

build:
  stage: build
  image: mcr.microsoft.com/dotnet/framework/aspnet
  script: 
    - echo "test"

一个 docker 容器与主机共享其内核。

这意味着,在您的情况下,您正在尝试 运行 基于 linux/amd64 主机中的 windows kernel 的 docker 图像,这不是可能。

如您在以下文档中所见, 此图像基于 Windows Server Core OS

https://hub.docker.com/_/microsoft-dotnet-framework-aspnet/

您可能会安装一个 windows gitlab runnerhttps://docs.gitlab.com/runner/install/windows.html