英文:
/bin/bash: line 89: docker: command not found GITLAB CI/CD ISSUE
问题
在Gitlab CI/CD中,我试图推送我的代码到Gitlab,但在推送阶段不断失败,并给出以下错误。有什么想法是什么原因导致这个错误?
推送阶段的问题如下:
1 正在使用gitlab-runner 12.6.0-rc1 (ec299e72)运行
2 在docker-auto-scale 72989761上
3
正在使用带有镜像ruby:2.5的Docker执行器...
00:36
4 正在拉取docker镜像ruby:2.5...
5 使用docker镜像sha256:54cb86b0bcdc353e103e9dd1bff69fcd01e3235420ed17cbf5efac22010b373e作为ruby:2.5...
7
正在通过runner-72989761-project-16138356-concurrent-0运行,通过runner-72989761-srm-1578059087-b5d7ed4b...
00:05
9
$ eval "$CI_PRE_CLONE_SCRIPT"
00:01
10 正在使用git深度设置为50获取更改...
11 初始化空的Git仓库
12 创建新的仓库。
14 * [new ref] refs/pipelines/106842100 -> refs/pipelines/106842100
15 * [new branch] master -> origin/master
16 检出54a35cd8作为master...
17 跳过Git子模块设置
21
$ docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
00:01
22 /bin/bash: line 89: docker: command not found
26 错误:作业失败:退出代码1
英文:
I am trying to push my code on Gitlab using Gitlab CI/CD but it constantly fails on the push stage giving me the below error.
Any ideas as to what's causing this?
Issue taken from the push stage:
1 Running with gitlab-runner 12.6.0-rc1 (ec299e72)
2 on docker-auto-scale 72989761
3
Using Docker executor with image ruby:2.5 ...
00:36
4 Pulling docker image ruby:2.5 ...
5 Using docker image sha256:54cb86b0bcdc353e103e9dd1bff69fcd01e3235420ed17cbf5efac22010b373e for ruby:2.5 ...
7
Running on runner-72989761-project-16138356-concurrent-0 via runner-72989761-srm-1578059087-b5d7ed4b...
00:05
9
$ eval "$CI_PRE_CLONE_SCRIPT"
00:01
10 Fetching changes with git depth set to 50...
11 Initialized empty Git repository
12 Created fresh repository.
14 * [new ref] refs/pipelines/106842100 -> refs/pipelines/106842100
15 * [new branch] master -> origin/master
16 Checking out 54a35cd8 as master...
17 Skipping Git submodules setup
21
$ docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
00:01
22 /bin/bash: line 89: docker: command not found
26 ERROR: Job failed: exit code 1
答案1
得分: 1
你正在使用一个 Ruby 镜像,该镜像要么没有安装 Docker,要么是在 $PATH
中的某个位置安装了 Docker。
如果没有安装 Docker,请使用 apt-get install docker
进行安装。
如果已经安装了 Docker,请通过 export PATH=$PATH:<docker_path>
添加 Docker 路径。
英文:
You're using a ruby image that either doesn't have docker or has it installed somewhere not in $PATH
.
If it does not have docker, install it via apt-get install docker
.
If it has, append docker path via export PATH=$PATH:<docker_path>
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论