Gitlab CI - docker:找不到命令 [英] Gitlab CI - docker: command not found

查看:44
本文介绍了Gitlab CI - docker:找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 gitlab ci 管道中构建我的 docker 映像.

I am trying to build my docker image within the gitlab ci pipeline.

但是找不到 docker 命令.

However it is not able to find the docker command.

/bin/bash:第 69 行:docker:找不到命令错误:作业失败:错误执行远程命令:命令以非零退出代码终止:在 Docker 容器中执行错误:1

/bin/bash: line 69: docker: command not found ERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1

.gitlab-ci.yml

stages:
  - quality
  - test
  - build
  - deploy

image: node:8.11.3

services:
  - mongo
  - docker:dind

before_script:
- npm install

quality:
  stage: quality
  script:
  - npm run-script lint

test:
  stage: test
  script:
  - npm run-script test

build:
  stage: build
  script:
  - docker build -t server .

deploy:
  stage: deploy
  script:
  - echo "TODO deploy push docker image"

推荐答案

你需要选择一个包含 docker 二进制文件的镜像

you need to choose an image including docker binaries

image: gitlab/dind

services:
  - docker:dind

这篇关于Gitlab CI - docker:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆