I build a Docker image based on jenkins/jenkins:lts-jdk11, and I set
JAVA_OPTS=-Djenkins.install.SetupWizard.adminInitialApiToken=11[32 hex digits]
Regardless of whether I set
-Djenkins.install.runSetupWizard=true
or
-Djenkins.install.runSetupWizard=false
the result is the same: The admin user has no API token configured.
My goal is to create an image with a known API token that I can use in scripts, without any manual configuration - and I cannot see how to achieve this.