Jenkins in docker including email credentials

58 views
Skip to first unread message

Wesley Connor

unread,
Jun 24, 2016, 6:28:55 AM6/24/16
to Jenkins Users
I am setting up a docker image which will start Jenkins in a known state, this will be deployed to multiple users to run standalone and it will populate its jobs from a dsl script in a separate repository.

By copying the files that I need from a running Jenkins instance I have been able to configure the Dockerfile so it starts with all relevant config set (plugins, configuration, email addresses etc)
However, I am unable to set the credentials for sending mail in the Mail plugin, I have tried importing all secret.key files and including all the files from the secrets directory. 
The problem is when I start up the instance Jenkins detects that there is possibly something wrong and then resets all the encrypted files. I realise that security is a good thing and Jenkins is doing the right thing, however I am fine with the email password being saved as the image will only be used internally.

Does anyone know the files I need to include so that I can preset the password for Jenkins or alternatively a way that i can set the email credentials on the command line, so that I can include it as a step when starting Jenkins, inside the docker image?

Thanks

Daniel Beck

unread,
Jun 24, 2016, 8:33:46 AM6/24/16
to jenkins...@googlegroups.com
https://wiki.jenkins-ci.org/display/JENKINS/Post-initialization+script may be an alternative to copying files around. It'll require some knowledge of Jenkins internals though.

I don't know how far along https://github.com/jenkinsci/system-config-dsl-plugin is, but it may be an alternative to the above in the near(ish) future.
> --
> 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/b3152fe7-a74f-4a18-96bf-9098ad79a974%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages