This docker image extends the official Jenkins docker image jenkins:lts/jenkins:lts-slim
with support for pre-installing plug-ins during container start and pre-configuring the Jenkins instance during container start via YAML files using the configuration-as-code plugin.
It is automatically built daily to include the latest OS security fixes.
You can find a list of available Jenkins plugins at plugins.jenkins.io
To pre-install plugins either:
-
define the environment variable
REQUIRED_PLUGINS
with the list of plugins to pre-install (separated by whitespace), e.g.$ docker run -rm -it \ -p 8080:8080 \ -e "REQUIRED_PLUGINS=greenballs:latest github:latest" \ vegardit/jenkins-ext:lts-slim
-
define the environment variable
REQUIRED_PLUGINS_FILE
pointing to a file containing the list of plugins to pre-install (separated by new lines).$ mkdir jenkins_data $ echo " greenballs:latest github:latest " > jenkins_data/required_plugins.txt $ docker run -rm -it \ -p 8080:8080 \ -e REQUIRED_PLUGINS_FILE=/required_plugins.txt \ -v myfolder/required_plugins.txt:/required_plugins.txt:ro \ vegardit/jenkins-ext:lts-slim
To keep pre-installed plugins between container restarts, mount a volume or local folder to /usr/share/jenkins/ref/plugins
, for example:
$ mkdir jenkins_data/plugins
$ chown -R 1000:1000 jenkins_data/plugins
$ docker run -rm -it \
-p 8080:8080 \
-e "REQUIRED_PLUGINS=greenballs:latest github:latest" \
-v jenkins_data/plugins:/usr/share/jenkins/ref/plugins:rw
vegardit/jenkins-ext:lts-slim
By default the configuration-as-code plugin is configured to look for YAML configuration files under
/usr/share/jenkins/ref/config/
during Jenkins start. This path can be configured by changing the environment variable CASC_JENKINS_CONFIG
.
# jenkins_data/base-config.yaml
jenkins:
noUsageStatistics: true
projectNamingStrategy:
pattern:
forceExistingJobs: false
namePattern: "[a-zA-Z0-9_-. ]+
$ docker run -rm -it \
-p 8080:8080 \
-v "jenkins_data/base-config.yaml:/usr/share/jenkins/ref/config/base-config.yaml:ro" \
vegardit/jenkins-ext:lts-slim
All files in this repository are released under the Apache License 2.0.
Individual files contain the following tag instead of the full license text:
SPDX-License-Identifier: Apache-2.0
This enables machine processing of license information based on the SPDX License Identifiers that are available here: https://spdx.org/licenses/.