繁体   English   中英

Gitlab 管道在“清理项目目录和基于文件的变量”时失败

[英]Gitlab pipeline failing on "Cleaning up project directory and file based variables"

我有一个 Gitlab 管道在尝试docker 构建时失败(使用Kaniko

我还没有成功构建 docker 但在我执行以下操作后这个特定错误已经开始:

  1. 将 kaniko 图像从image: gcr.io/kaniko-project/executor:debug 更改gcr.io/kaniko-project/executor:51734fc3a33e04f113487853d118608ba6ff2b81
  2. 添加了推送到不安全注册表的设置:--insecure --skip-tls-verify --skip-tls-verify-pull --insecure-pull

在此更改之后,管道的一部分如下所示:

before_script:
    - 'dotnet restore --packages $NUGET_PACKAGES_DIRECTORY'
  
  
  build_job:
    tags:
      - xxxx
    only:
      - develop
    stage: build
    script:
      - dotnet build --configuration Release --no-restore
  
  
  publish_job:
    tags:
      - xxxx
    only:
      - develop
    stage: publish
    artifacts:
        name: "$CI_COMMIT_SHA"
        paths:
          - ./$PUBLISH_DIR
    script:
      - dotnet publish ./src --configuration Release --output $(pwd)/$PUBLISH_DIR
    
docker_build_dev:
    tags:
      - xxxx
    image:
      name: gcr.io/kaniko-project/executor:51734fc3a33e04f113487853d118608ba6ff2b81
      entrypoint: [""]
    only:
      - develop
    stage: docker
    before_script:
      - echo "Docker build"
    script:
      - echo "${CI_PROJECT_DIR}"
      - cp ./src/Dockerfile /builds/xxx/xxx/xxx/Dockerfile
      - mkdir -p /kaniko/.docker
      - echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
      - >-
        /kaniko/executor
        --context "${CI_PROJECT_DIR}"
        --insecure
        --skip-tls-verify
        --skip-tls-verify-pull
        --insecure-pull
        --dockerfile "${CI_PROJECT_DIR}/Dockerfile"
        --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"

来自管道的部分 output 如下:

[32;1mSkipping Git submodules setup[0;m
section_end:1652535765:get_sources
[0Ksection_start:1652535765:download_artifacts
[0K[0K[36;1mDownloading artifacts[0;m[0;m
[32;1mDownloading artifacts for publish_job (33475)...[0;m
Downloading artifacts from coordinator... ok      [0;m  id[0;m=33475 responseStatus[0;m=200 OK token[xxxxxxxxxxx

section_end:1652535769:download_artifacts
[0Ksection_start:1652535769:step_script
[0K[0K[36;1mExecuting "step_script" stage of the job script[0;m[0;m
section_end:1652535769:step_script
[0Ksection_start:1652535769:cleanup_file_variables
[0K[0K[36;1mCleaning up project directory and file based variables[0;m[0;m

section_end:1652539354:cleanup_file_variables
[0K[31;1mERROR: Job failed: execution took longer than 1h0m0s seconds
[0;m

我错过了什么?

我在 GitLab 项目设置中遗漏了一些启用项目注册表的内容:

  1. https://domain/group/subgroup/project/edit
  2. 可见性、项目功能、权限 << Container Registry(切换以启用)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM