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. Hope something like this helps: https://gist.github.com/johnbuhay/c6213d3d12c8f848a385 On Thu, Mar 11, 2021 at 09:21 Jochen Wiedmann <[email protected]> wrote: > > 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 > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/bb7ef044-d9f0-484d-9c44-1433d2a9decfn%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/bb7ef044-d9f0-484d-9c44-1433d2a9decfn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CADgiF9%2BogJ%3Dn9iiYfbxxCNcUwSCuOsOhh2t5GfrY-r-G6aLNjA%40mail.gmail.com.
