Gitlab CI Build失败了gitlab-runner-prebuilt.tar.xz:没有这样的文件或目录

vpe*_*osa 23 gitlab gitlab-ci gitlab-ci-runner

我刚刚在我的开发机器(Ubuntu 17.10)上安装了Gitlab Runner进行测试.当我跑步时,我得到了:

$: sudo gitlab-runner exec docker test       
   Running with gitlab-ci-multi-runner dev (1.4.2)
   Using Docker executor with image php:5.6 ...
   ERROR: Build failed (system failure): open /var/lib/gitlab-runner/gitlab-runner-prebuilt.tar.xz: no such file or directory
   FATAL: open /var/lib/gitlab-runner/gitlab-runner-prebuilt.tar.xz: no such file or directory 
Run Code Online (Sandbox Code Playgroud)

.gitlab-ci.yml文件:

image: php:5.6

before_script:
  - php -v

stages:
  - test

test:
  script:
  - php -v
Run Code Online (Sandbox Code Playgroud)

目前的安装过程:

sudo apt-get install gitlab-runner
Run Code Online (Sandbox Code Playgroud)

输出:

...
Configuring gitlab-ci-multi-runner (1.4.2+dfsg-1) ...
I: generating GitLab Runner Docker image. This may take a while...
E: No mirror specified and no default available
W: please run 'sudo /usr/lib/gitlab-runner/mk-prebuilt-images.sh' to generate Docker image.
...
Run Code Online (Sandbox Code Playgroud)

所以我做了:

$: sudo /usr/lib/gitlab-runner/mk-prebuilt-images.sh
   I: generating GitLab Runner Docker image. This may take a while...
   E: No mirror specified and no default available
Run Code Online (Sandbox Code Playgroud)

Bar*_*ski 62

今天遇到了同样的问题.原来输入cdebootstrap命令mk-prebuilt-images.sh导致此错误消息:

cdebootstrap \
     --flavour=minimal \
     --exclude="dmsetup,e2fsprogs,init,systemd-sysv,systemd,udev" \
     --include="bash,ca-certificates,git,netcat-traditional" \
     stable ./debian-minbase
Run Code Online (Sandbox Code Playgroud)

将最后一行更改为:

     stable ./debian-minbase http://deb.debian.org/debian/ 
Run Code Online (Sandbox Code Playgroud)

该脚本现在应该没有任何错误地继续.有关debootstrap的更多信息,请点击此处.

  • 一年后的现在,我感到非常惊讶,昨天我在18.04上安装了gitlab-runner,这仍然是我修复的方式... (5认同)
  • 为什么要在其中放置“ http”而不是“ https” URL? (2认同)

Alc*_*lyn 13

当前接受的答案(编辑mk-prebuilt-images.sh脚本)对我不起作用,但我找到了如何针对我的情况修复它:

刚刚做的时候我错了apt-get install gitlab-runner,并检查了我的版本:

$ gitlab-runner -v
Version:      10.5.0
Run Code Online (Sandbox Code Playgroud)

不是最新版本,我希望有 12 版。

所以我找到了这个安装指南:

https://gitlab.com/gitlab-org/gitlab-runner/blob/master/docs/install/linux-repository.md

本指南说要添加一个最新的存储库

# For Debian/Ubuntu/Mint
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash

# For RHEL/CentOS/Fedora
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
Run Code Online (Sandbox Code Playgroud)

然后安装它:

apt-get update
apt-get install gitlab-runner
Run Code Online (Sandbox Code Playgroud)

现在我有:

$ gitlab-runner -v
Version:      12.3.0
Run Code Online (Sandbox Code Playgroud)

我可以在本地运行作业。