title: Jenkins with Docker on Windows - Cannot run program "nohup"
body: <p>I am using the <a href="https://plugins.jenkins.io/azure-vm-agents" rel="noreferrer">Jenkins Azure VM Agents Plugin</a> with a Linux Master, to launch jobs on Windows agents.</p>
  
  <p>I have been through all the configuration steps and everything works fine until I try to use Docker on the agents.</p>
  
  <p>My pipeline script:</p>
  
  <pre><code>pipeline {
      agent {
          docker {
              image 'myurl.io/myimage:latest'
              registryUrl 'https://myurl.io/'
              registryCredentialsId '123456789abcdefg'
          }
      }
  </code></pre>
  
  <p>The pipeline appears to fails on when it runs this command:</p>
  
  <pre><code>docker pull myurl.io/myimage:latest
  </code></pre>
  
  <p>The error reported comes down to this:</p>
  
  <pre><code>Caused: java.io.IOException: Cannot run program "nohup" (in directory "C:\Jenkins\workspace\Test Pipeline Docker"): CreateProcess error=2, The system cannot find the file specified
  </code></pre>
  
  <p>Some notes:</p>
  
  <ul>
  <li><p>I have ticked the box to install git on the image:
  <a href="https://i.stack.imgur.com/U4Ik0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U4Ik0.png" alt="enter image description here"></a></p></li>
  <li><p>The Git tools appear to be successfully installed on the agent VM</p></li>
  <li><p><a href="https://stackoverflow.com/questions/45140614/jenkins-pipeline-sh-fail-with-cannot-run-program-nohup-on-windows">This question</a> seems to be related but is it not exactly the same</p>
  
  <ul>
  <li>I am not running the <code>sh</code> command directly, it is being run by the plugin.</li>
  <li>I do not think I have access to set the <code>PATH</code> at this stage</li>
  </ul></li>
  <li>This issue on JIRA <a href="https://issues.jenkins-ci.org/browse/JENKINS-36776" rel="noreferrer">https://issues.jenkins-ci.org/browse/JENKINS-36776</a> is related, but it does not seems to be fixed and the suggested workarounds don't seem to apply to my situation</li>
  </ul>
  
  <p>My question</p>
  
  <p>Is there a way to get my pipeline script to work? Maybe there are some extra commands I can somehow execute on the agent after it launches - but before the <code>docker pull</code> command - to add the required directories to the <code>PATH</code>?</p>
  
  <p>Or is there some other workaround? </p>