Jenkins Jobs Folder in Docker

193 views
Skip to first unread message

Bruce Coveny

unread,
Apr 9, 2021, 11:44:56 AM4/9/21
to Jenkins Users
Hello,

I am building a custom docker image from jenkins/jenkins.  I would like to have the jobs, builds, and workspace folder be on an external volumne from from the container, but keep the rest of the configuration inside the container.

I have found where it is possible to set flags for builds and workspace, however, cannot find anything to externalize jobs folder.  Is this possible?

Thanks
Bruce

Martin Schmude

unread,
Apr 9, 2021, 12:37:03 PM4/9/21
to Jenkins Users
This is similar to the customized docker image that we build for Jenkins.
We just leave the $JENKINS_HOME/jobs folder intentionally inside the container. so that all job configurations are part of the docker image.
A Jenkins instance started from such an image has all its jobs available out-of-the-box.

There is in fact no option to tell Jenkins to use a different jobs folder other then $JENKINS_HOME/jobs.
As a workaround you could replace the $JENKINS_HOME/jobs folder by a link to e.g. /var/jenkins/jobs and let docker map a volume to /var/jenkins.
Reply all
Reply to author
Forward
0 new messages