2

I downloaded Jenkins on my macOS machine and can access it just fine. I also have Docker installed on my MacOS. I have created a basic freestyle project on Jenkins with a single shell command; the command is simply a test to be sure Jenkins can make use of Docker on my machine: docker -v.

Running the above command on my macOS terminal prints the docker version. But running the command as an "execute shell" build step in Jenkins throws the following error:

Started by user vismarkjuarez
Running as SYSTEM
Building in workspace /Users/vismarkjuarez/.jenkins/workspace/Test1
[Test1] $ /bin/sh -xe /var/folders/96/ld81p3156gdcry2gyrq888ww0000gn/T/jenkins4205572273474072782.sh
+ docker -v
/var/folders/96/ld81p3156gdcry2gyrq888ww0000gn/T/jenkins4205572273474072782.sh: line 2: docker: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE

I think I need to configure Jenkins to point it to my MacOS Docker installation but am not sure how this is done. Most of the information I see online deals with configuring Jenkins as a Docker container. I'm running Jenkins on a macOS though.

Vismark Juarez
  • 613
  • 4
  • 14
  • 21
  • you can do `echo $PATH` and `which docker` in both environments then fix the [path in Jenkins](https://stackoverflow.com/questions/36473479/how-to-set-the-path-environment-variable-in-jenkins-configuration-on-windows) you might have further problems with permissions – KeepCalmAndCarryOn Jun 05 '20 at 08:27
  • Please add the Jenkins user (if you are using this user to run Jenkins) to docker group. If need be, change the permission of docker.sock to read and executable for all users. – Sourav Jun 08 '20 at 10:22

0 Answers0