'/bin/bash: line 120: docker: command not found
Getting the error in Gitlab, when I was using below gitlab-ci.yaml troubleshoot and investigated by changing the image and permissions & ownership at the OS level for docker file, but it didn't help
/bin/bash: line 120: docker: command not found
when executing the job from GitLab, we get the error. .gitlab-ci.yaml
stages:
- build-stage
- deploy-stage
image: docker
build:
script:
- docker --version
- docker build -t pyapp .
tags:
- linux
stage: build-stage
deploy:
script:
- docker stop python-container || true && docker rm python-container || true
- docker run -d --name python-container -p 80:8080 pyapp
- echo "Commit author is:" $CI_COMMIT_AUTHOR
tags:
- linux
stage: deploy-stage
Solution 1:[1]
I spent a lot of time, earlier I thought it could be an issue with the docker engine or permissions or something with the OS platform.
while running the
gitlab-runner register
We need to provide or modify the executor, in my case earlier it was docker I changed it to shell and it worked for me
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jagdish0886 |
