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.

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

  • Symfony 3 with Docker and nginx
  • How to share host network bridge when using docker in docker
  • Docker Toolbox SSH Login
  • Is NoRestart policy supported for Kubernetes pods?
  • How to access docker web app through ssh?
  • Docker service failed to start application container engine on CentOS7
  • 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/group.com.docker/bin/docker --version
    

    Question : Why docker command can’t look into correct path ?

    Permissions

    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.

    Regards,
    Vikram

  • What is the right way to deploy Node/Express/Mongo/React app with Docker?
  • Spring Properties from Docker Environment Variables
  • Docker fig multiple server deployment
  • How to see the log information in running docker daemon?
  • How to place files on shared volume from within Dockerfile?
  • Use docker in restricted internet environnement
  • 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/group.com.docker/bin/
    

    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.