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