Automatically create initial admin user

16 views
Skip to first unread message

Jochen Wiedmann

unread,
Mar 11, 2021, 10:21:19 AM3/11/21
to Jenkins Users

Hi,

I am trying to set up a docker image, which should be ready to use. In particular, I wouldn't want the image user to read the contents of the initial_admin_password file from the Docker log or from the running container. Instead, I would want something like "Read the initial admin details from a file, which I specify be setting an environment variable." Or, whatever works.

How would you do that?

Thanks,

Jochen

Jan Monterrubio

unread,
Mar 11, 2021, 2:46:49 PM3/11/21
to jenkins...@googlegroups.com
We have some code that enables security and sets the admin user with credentials admin/hunter2 based on it an ENABLE_SECURITY environment variable is set. 

Look for Jenkins init groovy samples to configure the admin password , you should be able to accomplish what you want with a little bit of tweaking.  


--
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/bb7ef044-d9f0-484d-9c44-1433d2a9decfn%40googlegroups.com.

Ivan Fernandez Calvo

unread,
Mar 12, 2021, 4:55:55 AM3/12/21
to Jenkins Users
you can use Jenkins Configuration as Code plugin (https://github.com/jenkinsci/configuration-as-code-plugin) to configure your security see the Matrix Authentication example  at https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos/matrix-auth
Reply all
Reply to author
Forward
0 new messages