docker: command not found ( mac mini ) only happens in jenkins shell step but work from command prompt
I’m facing this weird problem , struggling to solve since almost couple of days.
but when I run a jenkins job , inside shell command step docker is not recognized.
I’m getting error
docker: command not found docker --version
But mentioning explicit path of docker , does work
/Users/buildserver/Library/Group\ Containers/group.com.docker/bin/docker --version
Question : Why docker command can’t look into correct path ?
lrwxr-xr-x 1 buildserver staff 71 Oct 14 10:44 docker -> /Users/buildserver/Library/Group Containers/group.com.docker/bin/docker
jenkins uses is part of staff group.
Thanks in advance.
One Solution collect form web for “docker: command not found ( mac mini ) only happens in jenkins shell step but work from command prompt”
PATH which Jenkins jobs start with isn’t the same as the path which the Jenkins user sees in bash. In the Jenkins UI you can edit the environment varables (from Manage Jenkins/Configure System), and add the Docker folder to
PATH -> $PATH:/Users/buildserver/Library/Group\ Containers/group.com.docker/bin/
Some more detail in the answer to this question.