Windows Docker Agent Images: General Availability
We would like to announce the availability of official Windows agent images for Docker. These images allow provisioning Jenkins agents with Windows OS on Docker and Kubernetes.
All official Docker images for agents now provide
windowsservercore-1809 tags which include Windows images and, at the moment, Java 8 (these are like the
We also provide tags with explicit Java selection, e.g.
Version tags are also available, e.g.
jenkins/agent is a basic agent which bundles the agent.jar for agent ⇐ ⇒ controller communication. This is most useful as a base image for other images. Windows images are available starting from version 4.3-4
jenkins/inbound-agent is an agent that is based on the jenkins/agent image above. It provides a wrapper script written in PowerShell to help specify the parameters to agent.jar. Windows images are available starting from version 4.3-4
To use the new images, you will need a proper Docker or Kubernetes environment which supports running Windows containers. For Windows desktop users, the easiest way is to use Docker for Windows. Windows support in Kubernetes is documented here.
The jenkins/agent image is a simple agent with the JDK and the agent.jar (Jenkins Remoting library).
There are two main use cases for this image:
As a base image for other Docker images (e.g.,
FROM jenkins/agent:jdk8-nanoserver-1809in your Dockerfile). The jenkins/inbound-agent is based on this image.
This image may also be used to launch an agent using the Launch method of Launch agent via execution of command on the master. This allows the controller to launch the agent inside the docker container automatically.
To run the agent for the second use case, you would specify the following command on the Jenkins controller after setting Remote root directory to
docker run -i --rm --name agent --init jenkins/agent:jdk8-windowsservercore-1809 java -jar C:/ProgramData/Jenkins/agent.jar
The inbound-agent Docker image tries to provide a higher level interaction with the agent.jar executable. It provides a PowerShell wrapper script around agent.jar and it is specified as the entrypoint so that you just need to pass in some command line arguments to run the agent. A pull request has been opened which documents these command line parameters and environment variables.
docker run jenkins/inbound-agent:windowsservercore-1809 ` -Url http://jenkins-server:port ` -WorkDir=C:/Users/jenkins/Agent ` -Secret <SECRET> ` -Name <AGENTNAME>
Example using environment variables:
docker run -e "JENKINS_URL=http://jenkins-server:port" -e "JENKINS_AGENT_NAME=AGENTNAME" ` jenkins/inbound-agent:windowsservercore-1809 ` -WorkDir=C:/Users/jenkins/Agent ` -Secret <SECRET> ` -Name <AGENTNAME>
As mentioned above the jenkins/ssh-agent docker image is based on SSH communication with the controller, rather than the remoting TCP or WebSocket protocols. The image sets up a
jenkins user and the OpenSSH server so that the controller can connect to the agent via SSH. The image expects an SSH public key as a parameter and puts that key into the
authorized_keys file for the
jenkins user. The private key should be specified in the agent configuration on the controller to allow the controller to connect.
docker run jenkins/ssh-agent:jdk8-windowsservercore-1809 "<public key>"
You can also pass the public key as an environment variable when using
docker run -e "JENKINS_AGENT_SSH_PUBKEY=<public key>" jenkins/ssh-agent:jdk8-windowsservercore-1809
You will then be able to connect this agent using the SSH Build Agents Plugin as "jenkins" with the matching private key.
We are considering providing versions based on Windows Server 2019 build 1909 so that Jenkins users can run these images on GKE clusters (see this issue).
We are also looking into providing multiarch manifests which would allow Windows images to be part of the
There is also an open pull-request to create a Windows based Docker image for a Jenkins controller. There hasn’t been a lot of requests for this, but to make the offerings complete for Windows users, the pull request was created.
For plans unrelated to Windows, please see the Docker images for agents: New names and What’s next blogpost.