I have two machines - a Jenkins server and a separate machine for running Docker containers. Both are Windows machines.

The Jenkins server has a pipeline script (jenkinsfile) which in one stage calls a remote Powershell script. This tells the second machine to pull the latest version of a Docker image and restart its container.

However, when Jenkins makes the call the pull fails (although the restart line does work). It suggests that I need to do a docker login.

If I manually login to the jenkins machine and remotely call the script from a Powershell window all is fine. The second machine pulls the image and restarts the container.

Both machines are logged in (using Docker for Windows) to the relevant account.

Adding a docker login statement before the pull in the Powershell script makes no difference.

Jenkins is running under an account with administrator access.

0 Answers