gitlab 无法升级连接:找不到容器(“build”)

问题描述 投票:0回答:1

我在 Nexus 仓库中有 2 张图片 我想把它们一一下载下来。 GitLab 运行程序中的第一个管道抛出错误,是 GitLab 缺少配置吗:

这是从 GitLab 运行器返回的错误:

Created fresh repository.
Checking out 0190bbde as master...
Skipping Git submodules setup
Executing "step_script" stage of the job script
30:01
Cleaning up file based variables
30:00
ERROR: Job failed (system failure): unable to upgrade connection: container not found ("build")

gitlab-ci.yml

stages:
  - build
  - test

scan-image:
  stage: build
  image: $CI_REGISTRY/devops/grype/grype:0.23
  # name: $CI_REGISTRY/grype:0.23
  # entrypoint: [""]
  variables:
    DOCKER_TLS_CERTDIR: ""
    DOCKER_HOST: tcp://localhost:2375
  services:
    - $CI_REGISTRY/devops/docker:dind-nx1.0
  tags:
    - k8s
  before_script:
   - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - docker pull $CI_REGISTRY/devops/grype/grype:0.23
    #- grype $CI_REGISTRY/devops/docker:latest
    #- grype $CI_REGISTRY/trivy-db:v1-2021101500 


download-image:
  stage: test
  image: $CI_REGISTRY/devops/docker:latest
  variables:
    DOCKER_TLS_CERTDIR: ""
    DOCKER_HOST: tcp://localhost:2375
  services:
    - $CI_REGISTRY/devops/docker:dind-nx1.0
  tags:
    - k8s
  before_script:
   - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
     - docker pull $CI_REGISTRY/trivy-db:v1-2021101500
     - grype $CI_REGISTRY/trivy-db:v1-2021101500 
docker gitlab gitlab-ci gitlab-ci-runner
1个回答
0
投票

原因应该是:Gitlab runner没有找到Kaniko镜像。
这是doc

Gtilab runner version: 15.11.0 (436955cb)  kubernetes  amd64/linux

Preparing environment
00:17
Waiting for pod gitlab-runner/runner-8nh** to be running, status is Pending
    ContainersNotInitialized: "containers with incomplete status: [init-permissions]"
    ContainersNotReady: "containers with unready status: [build helper]"
    ContainersNotReady: "containers with unready status: [build helper]"
ERROR: Job failed (system failure): prepare environment: setting up trapping scripts on emptyDir: unable to upgrade connection: container not found ("build"). Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
© www.soinside.com 2019 - 2024. All rights reserved.