简体   繁体   中英

/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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM