Hi thanks for the official image on https://hub.docker.com/_/jenkins/. Since users are likely to be switching to a docker deployment from an existing jenkins system, please mention how to generate the plugins.txt to copy to /usr/share/jenkins/ref/.
This url allows you can see all the plugins and versions installed on an existing instance:
http://JENKINS:8080/systemInfo
It might be easier to turn the xml into a plugins.txt:
http://JENKINS:8080/pluginManager/api/xml?depth=1&xpath=/_/_/shortName|/_/_/version&wrapper=plugins
Also nice to include the "jobs" directory in the example for pre-configuring the new instance.
ADD jobs /usr/share/jenkins/ref/
isn't this already covered in https://github.com/jenkinsci/docker#preinstalling-plugins ?
Ah thanks, yes it is, can that curl be copied to the hub.docker.com instructions or linked?
It seems the hub instructions refer to https://github.com/docker-library/ a lot maybe it should link to https://github.com/jenkinsci/docker if that's where the more complete / up to date instructions are?
The link provided by @jamshid does not seem to work on our Jenkins (v2.73.1), I use the following .groovy script
Jenkins.instance.pluginManager.plugins.each{
plugin ->
println ("${plugin.getShortName()}: ${plugin.getVersion()}")
}
This can be executed from the "Script" console at https://YOUR_JENKINS_URL/script (assuming you are admin)
@espenalb can you fix the sample, there is no space after :
${plugin.getShortName()}:${plugin.getVersion()}
Related JIRA issue : https://issues.jenkins-ci.org/browse/JENKINS-40128
@espenalb Thanks for the handy Groovy! For newer versions of Jenkins than 2.8x you will need to coerce the return to a specific type. https://stackoverflow.com/a/48198920/3794873
Most helpful comment
The link provided by @jamshid does not seem to work on our Jenkins (v2.73.1), I use the following .groovy script
This can be executed from the "Script" console at https://YOUR_JENKINS_URL/script (assuming you are admin)