I am trying out docker with jenkins with help of this tutorial https://jenkins.io/doc/tutorials/build-a-java-app-with-maven/#create-your-initial-pipeline-as-a-jenkinsfile I am running the Jenkinsfile. Jenkins runs the script.sh: docker inspect -f . maven:3-alpine, which should install a docker instance and then I get an error "Cannot run program nohup". Is it possible that the docker container doesn't know the command and I how to add it myself? What else could it be?
-
Possible duplicate of [Jenkins pipeline sh fail with "cannot run program nohup" on windows](https://stackoverflow.com/questions/45140614/jenkins-pipeline-sh-fail-with-cannot-run-program-nohup-on-windows) – Eduardo Gonçalves Aug 13 '18 at 12:39
-
Here's a question similar to yours, [Try this](https://stackoverflow.com/questions/45140614/jenkins-pipeline-sh-fail-with-cannot-run-program-nohup-on-windows?answertab=votes#tab-top) – Eduardo Gonçalves Aug 13 '18 at 12:42
3 Answers
if you are trying to run the nohup command on the master then the base image for jenkins might not be having it installed. You will have install the additional utilities on the container running as jenkins master , else you can define a slave that has docker engine and the required utlities installed.

- 861
- 5
- 5
The possible duplicate question Jenkins pipeline sh fail with “cannot run program nohup” on windows suggested by Eduardo Gonçalves in the comments above does solve part of the problem. More accurate: the mklink of nohup.exe file to both the git/cmd and git/bin did the first trick. Afterwards I had to mklink the sh.exe as well.

- 55
- 1
- 7
As of https://issues.jenkins-ci.org/browse/JENKINS-36776 this should be resolved when you install Version 1.21 of Plugin "Docker Pipeline" https://github.com/jenkinsci/docker-workflow-plugin/releases/tag/docker-workflow-1.21 . That worked for me.

- 1
- 2