之前的文章介绍了GitLab Runner安装,在Ubuntu上默认直接安装了gitlab-runner,命令为:

sudo  apt install gitlab-runner

但其实安装的版本为10.5.0,使用命令gitlab-runner -v可以查看,在运行docker executor出现错误:

 Gitlab CI Build failed gitlab-runner-prebuilt.tar.xz: no such file or directory

出现这个问题的原因是因为gitlab-runner的版本过低,当前gitlab-runner最新版本为:12.7.1
解决办法:升级gitlab-runner为最新版本,先升级包:

# 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

需要先安装curl。
再安装最近版本的gitlab-runner:

apt update
apt upgrade  
# or
apt install gitlab-runner

查看当前gitlab-runner版本:

gitlab-runner -v
Version:      12.7.1
Git revision: 003fe500
Git branch:   12-7-stable
GO version:   go1.13.5
Built:        2020-01-23T09:08:54+0000
OS/Arch:      linux/amd64

本文由 Matrixport 姜家志 编写,转载无需授权
Matrixport是一站式数字资产金融服务平台,致力于打造下一代数字金融平台,为加密经济而生


姜家志
2.3k 声望148 粉丝

尽力了!才有资格说运气不好。