Gitlab CI 准备环境:来自守护进程的错误响应:hcsshim::CreateComputeSystem

Gitlab CI prepare environment: Error response from daemon: hcsshim::CreateComputeSystem

我创建了一个 windows 图像,并将其推送到自定义注册表。 图像构建没有任何错误。它也可以在使用命令 docker run.

的任何机器上完美运行

我在 windows 主机上使用配置为使用 docker-windows 的 gitlab 运行器。 当在 shell.

中使用命令 docker run 时,图像在 windows 主机上也能完美运行

但是,当 gitlab CI 触发管道时,我得到以下包含错误的日志:

Running with gitlab-runner 14.9.0 (d1f69508)
  on Test windows docker runner daSVobYW
Preparing the "docker-windows" executor 00:01
Using Docker executor with image someaddress:someport/windows_msvc2019_qt-desktop-6.2.3:v1.0.0 ...
Pulling docker image someaddress:someport/windows_msvc2019_qt-desktop-6.2.3:v1.0.0 ...
Using docker image sha256:XXX for someaddress:someport/windows_msvc2019_qt-desktop-6.2.3:v1.0.0 with digest someaddress:someport/windows_msvc2019_qt-desktop-6.2.3@sha256:XXX ...
Preparing environment
ERROR: Job failed (system failure): prepare environment: Error response from daemon: hcsshim::CreateComputeSystem 2f20866e4110118edc3274945d93d6138a16a67f9865d325e8b81c572ce08b96: Access denied. (exec.go:73:0s). Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

我查看了指向的网页,但没有找到适合我的问题的答案。 有什么想法吗?

这是我的 docker 信息输出:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.1)
  compose: Docker Compose (Docker Inc., v2.3.3)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 15
  Running: 0
  Paused: 0
  Stopped: 15
 Images: 5
 Server Version: 20.10.13
 Storage Driver: windowsfilter (windows) lcow (linux)
  Windows:
  LCOW:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: hyperv
 Kernel Version: 10.0 19044 (19041.1.amd64fre.vb_release.191206-1406)
 Operating System: Windows 10 Pro Version 2009 (OS Build 19044.1586)
 OSType: windows
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.9GiB
 Name: RUNNERNAME
 ID: 35KO:UJAL:TZQ6:KA57:7Q3I:QTLO:YCTI:AR2Y:TIDC:K4UL:VYJ5:BPWR
 Docker Root Dir: C:\ProgramData\Docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: true
 Insecure Registries: someaddress:someport
 Live Restore Enabled: false
 Product License: Community Engine

以及gitlab runner配置文件的内容:

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  url = "someurl"
  token = "sometoken"
  executor = "docker-windows"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.docker]
    tls_verify = false
    image = "someaddress:someport/windows_msvc2019_qt-desktop-6.2.3"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["c:\cache"]
    shm_size = 0

我在使用 Docker 4.6.0 及更高版本时遇到了同样的问题。 尝试从这里 https://docs.docker.com/desktop/windows/release-notes/ 安装 docker 4.5.1 并告诉我这是否适合你。