IIUC your issue has just to do with the fact the file you're passing is located on the host, hence not accessible to the container.
So, you're left with two options:
* the right one: inherit the official image and customize it with a dedicated Dockerfile
* the quick and dirty one: bind mount the file you need (using -v) so that it can be found when the Jenkins container starts. Note that you want to avoid docker bind-mounts in general, so IMO this solution would possibly only be used for quickly PoCing what you want.
Cheers
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e2c7a120-b305-419f-8768-5cb6803b3899%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
My goal is to load some custom jars into Jenkins so I am mounting this directory already.
When i use docker-compose
I have to do something like
docker-compose run -d --commonLibFolder={libDirectoryLocation} << This works perfectly
I looked into this a bit and jenkins sets this as sun.java.command, so in the jenkins system information page , i can see
sun.java.command /usr/share/jenkins/jenkins.war --commonLibLocation={libDirectoryLocation}
I am trying to find an alternate way to do this, so that i don't have to type in such a big command (one of the purposes of docker compose)
I have tried a few things
- Environment variables(sun.java.command) - This creates a second entry and does not work
- JENKINS_OPTS , JENKINS_ARGS (i have used this approach outside docker to customize classpath)
Nothing seems to work, i am sure i am am missing something but i can't figure out what..