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

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

问题描述

我正在尝试在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 binaries的映像

you need to choose an image including docker binaries

image: gitlab/dind

services:
  - docker:dind

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

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