Skip to content

sebok/docker-slave

 
 

Repository files navigation

Jenkins Agent Docker image

Join the chat at https://gitter.im/jenkinsci/docker-slave Docker Stars Docker Pulls Docker Automated build GitHub release

This is a base image for Docker, which includes JDK and the Jenkins agent executable (agent.jar). This executable is an instance of the Jenkins Remoting library. JDK version depends on the image and the platform, see the Configurations section below.

Changelog

See GitHub releases for versions 3.35-1 and above. There is no changelog for previous versions, see the commit history.

Usage

This image is used as the basis for the Docker JNLP Agent image. In that image, the container is launched externally and attaches to Jenkins.

This image may instead be used to launch an agent using the Launch method of Launch agent via execution of command on the master. For example on Linux you can try

docker run -i --rm --name agent --init jenkins/slave java -jar /usr/share/jenkins/agent.jar

after setting Remote root directory to /home/jenkins/agent.

or if using Windows

docker run -i --rm --name agent --init jenkins/agent:latest-windows java -jar C:/ProgramData/Jenkins/agent.jar

after setting Remote root directory to C:\Users\jenkins\Agent.

Agent Work Directories

Starting from Remoting 3.8 there is a support of Work directories, which provides logging by default and change the JAR Caching behavior.

Call example for Linux:

docker run -i --rm --name agent1 --init -v agent1-workdir:/home/jenkins/agent jenkins/slave java -jar /usr/share/jenkins/agent.jar -workDir /home/jenkins/agent

Call example for Windows:

docker run -i --rm --name agent1 --init -v agent1-workdir:C:/Users/jenkins/Agent jenkins/agent:latest-windows java -jar C:/ProgramData/Jenkins/agent.jar -workDir C:/Users/jenkins/Agent

Configurations

The image has several supported configurations, which can be accessed via the following tags:

  • latest: Latest version with the newest remoting (based on openjdk:8-jdk)
  • latest-jdk11: Latest version with the newest remoting and Java 11 (based on openjdk:11-jdk)
  • alpine: Small image based on Alpine Linux (based on openjdk:8-jdk-alpine)
  • jenkins4eval/agent:latest-windows: Latest version with the newest remoting (based on openjdk:8-jdk-windowsservercore-1809)
  • jenkins4eval/agent:latest-windows-jdk11: Latest version with the newest remoting and Java 11 (based on openjdk:11.0-jdk-windowsservercore-1809)
  • 2.62: This version bundles Remoting 2.x, which is compatible with Jenkins servers running on Java 6 (1.609.4 and below)
  • 2.62-alpine: Small image with Remoting 2.x
  • 2.62-jdk11: Versioned image for Java 11

Java 11 Support

Java 11 support is available for Debian-based images and Windows images. Alpine image for Java 11 will not be provided, see JENKINS-54487. There is a probability that images for Java 11 will be changed to AdoptOpenJDK base images in the future.

About

Base Docker image for Jenkins Agents

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 49.4%
  • Dockerfile 20.3%
  • PowerShell 19.0%
  • Makefile 11.3%