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.

On mac mini command prompt , I switch to jenkins user and can run docker command without any problem.

  • Scaling a two-tier MEAN application with Docker on AWS
  • Run docker daemon using specific cgroup mount
  • Browserify/Babelify gulp build malfunction in Docker container - cannot find component module
  • Pass “volume-driver” option to kubernetes pod
  • Docker container prefer host eth0 over wlan0 for internet
  • How can I forward localhost port on my container to localhost on my host?
  • Not Working:
    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/ --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/

    jenkins uses is part of staff group.

    Thanks in advance.


  • Docker overlay networking centos7
  • Automated Dockerfile generator
  • why docker image management create date is stale
  • Docker cannot write to assets folder as web server process in Yii/PHP application locally OS X
  • Parallel test processes within docker container
  • Tensorflow: unable to navigate to tensorflow folder using docker [Windows 10 Home edition]
  • One Solution collect form web for “docker: command not found ( mac mini ) only happens in jenkins shell step but work from command prompt”

    The 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 -> $PATH:/Users/buildserver/Library/Group\ Containers/

    Some more detail in the answer to this question.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.