Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab CI - docker: command not found

Tags:

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

However it is not able to find the docker command.

/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" 
like image 546
Kay Avatar asked Jul 05 '18 16:07

Kay


People also ask

Does GitLab CI use Docker?

GitLab CI in conjunction with GitLab Runner can use Docker Engine to test and build any application. Docker is an open-source project that allows you to use predefined images to run applications in independent "containers" that are run within a single Linux instance.

What is GitLab runner executor?

GitLab Runner implements a number of executors that can be used to run your build. It determines the environment each job runs in. For example, If I want CI/CD job to run PowerShell commands, I might install GitLab Runner on a server and then register a runner that uses the shell executor.

Is Docker required for GitLab runner?

GitLab Runner can be installed on Linux, macOS and Windows. For our sample project, a small server instance with 1 GB RAM should be enough. In addition, since we will be running with the Docker executor, we also need to have Docker Engine installed.

What is Docker runner?

Docker Runner is a Bamboo feature that allows you to run builds and deployments in a Docker container. This isolates the build process from the rest of the environment it runs in.


1 Answers

you need to choose an image including docker binaries

image: gitlab/dind  services:   - docker:dind 
like image 51
Hieu Vo Avatar answered Oct 22 '22 09:10

Hieu Vo