Based on jenkins/slave/ Dockerfile and jenkins/jnlp-slave/ Dockerfile.
It seeks to maintain a general jenkins slave build image that has a number of common languages and build tools already installed. Languages are installed using version managers. If a specific version is needed at build time, you can use the specific env manager to utilize that version.
- Corretto 8 (OpenJDK Java 8) - Default
- Corretto 11(OpenJDK Java 11)
- Maven 3.6.0
- Use alternatives to switch versions
- alternatives --set java $JAVA_CORRETTO_8_PATH
- alternatives --set javac $JAVAC_CORRETTO_8_PATH
- alternatives --set java $JAVA_CORRETTO_11_PATH
- alternatives --set javac $JAVAC_CORRETTO_11_PATH
sudo alternatives --set java $JAVA_CORRETTO_8_PATH
sudo alternatives --set javac $JAVAC_CORRETTO_8_PATH
sudo alternatives --set java $JAVA_CORRETTO_11_PATH
sudo alternatives --set javac $JAVAC_CORRETTO_11_PATH
- JAVA_HOME will correctly point to the new version since it points to
/usr/lib/jvm/java
- Node Dubnium 10.15.3 - Default
- Node Carbon 8.15.1
- NPM
- Yarn
- nodenv
- Python 3.6.8 - Default
- Python 2.7.14 - System
- pip
- pyenv
- Golang 1.12.3 - Default
- Golang 1.11.8
- goenv
- PHP 7.0.31 - Default
- PHP 7.3.3 - System
- Composer
- phpenv
- docker (18.06.1-ce)
- awscli (aws-cli/1.16.140 Python/3.6.8 Linux/4.9.125-linuxkit botocore/1.12.130)
- jq (jq-1.5)
To run a Docker container
docker run pwbsladek/jenkins-amazonlinux2-jnlp-slave -url http://jenkins-server:port <secret> <agent name>
To run a Docker container with Work Directory:
docker run pwbsladek/jenkins-amazonlinux2-jnlp-slave -url http://jenkins-server:port -workDir=/home/jenkins/agent <secret> <agent name>
Optional environment variables:
JENKINS_URL
: url for the Jenkins server, can be used as a replacement to-url
option, or to set alternate jenkins URLJENKINS_TUNNEL
: (HOST:PORT
) connect to this agent host and port instead of Jenkins server, assuming this one do route TCP traffic to Jenkins master. Useful when when Jenkins runs behind a load balancer, reverse proxy, etc.JENKINS_SECRET
: agent secret, if not set as an argumentJENKINS_AGENT_NAME
: agent name, if not set as an argumentJENKINS_AGENT_WORKDIR
: agent work directory, if not set by optional parameter-workDir
By default, the JNLP3-connect is disabled due to the known stability and scalability issues.
You can enable this protocol on your own risk using the
JNLP_PROTOCOL_OPTS=-Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=false
property (the protocol should be enabled on the master side as well).
In Jenkins versions starting from 2.27
there is a JNLP4-connect protocol.
If you use Jenkins 2.32.x LTS
, it is recommended to enable the protocol on your instance.
Make sure your ECS container agent is updated before running. Older versions do not properly handle the entryPoint parameter. See the entryPoint definition for more information.