As of May 2021, this project has been deprecated and is now archived in favor of using vela
FROM target/jenkins-docker-master:2.176.1
COPY scripts-directory /usr/share/jenkins/ref/init.groovy.d/script.groovy
Example docker service command:
docker service create --name <name> --mount type=bind,src=/path/to/source,dst=/var/jenkins_home
-e JENKINS_URL=https://<jenkins url> -e JENKINS_SLAVE_AGENT_PORT=<jnlp port>
--network <network name> --publish <jnlp port> --restart-condition on-failure
target/jenkins-docker-master:2.176.1
Example gelvedere command:
gelvedere --user-config /jenkins/user-configs/test.json --admin-config /jenkins/admin-configs/test.json --domain acme.com
The majority of base configuration should be done with groovy scripts when the image is created or started for the first time and as such, we have provided example groovy scripts here.
The images take advantage of a few plugins to handle auth:
An example setup script can be found here
Various ways exist to report metrics from Jenkins, so we won't go into deep details of available options. However, we have had good luck with using the jmx2graphite jar in conjunction with metrics and metrics-graphite plugins.
An example reporting script can be found here
The following environment variables can be used to set up Jenkins:
Variable | Description | Example |
---|---|---|
JENKINS_SLAVE_AGENT_PORT | The TCP port for the slave agent to use. Must be unique to the cluster. | 5001 |
JAVA_OPTS | Additional java options for running. | --server -XX:+UseG1GC |
The jenkins-docker-master
images come in a couple of flavors, each designed for a specific use case. All of the images extend the official Jenkins LTS images
and as such, many of the options prescribed there apply to this image as well.
This is the de facto image. It is based off of jenkins/jenkins:2.277.1
and includes a few modifications. It was created with the intention to be extended by using groovy scripts to setup ACLs using various plugins and as such, we have provided example groovy scripts here.
This image is based off of the jenkins-docker-master:2.277.1-1
image. The noticeable difference is in relation to increasing log verbosity for troubleshooting.