0

When I try to run my gitlab-ci.yml, I get the following error:

/bin/bash: line 73: docker: command not found

On my server the docker command works as root and gitlab is also executing as root.

What could be the problem here?

Here is my .yml file:

stages:
  - deploy
  - cleanup

before_script:
  - whoami
  - docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
veben
  • 19,637
  • 14
  • 60
  • 80
user9468014
  • 479
  • 2
  • 6
  • 20

2 Answers2

0

You can verify these 3 steps:

  1. Is Docker Engine installed on server
  2. Is the gitlab-runner user added to docker group
  3. Has the gitlab-runner access to Docker

Follow the official page for more information: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html

veben
  • 19,637
  • 14
  • 60
  • 80
0

Your gitlab-ci.yml looks incomplete. Try something like this:

stages:
  - build

build-docker:
  stage: build
  script:
     - whoami
     - docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"

Matthew
  • 10,361
  • 5
  • 42
  • 54