Overriding application properties with environment variable in Camunda BPM Run docker

Hi all. I’ve pulled the run distribution of the camunda-bpm-platform Docker image. I’m still using the default.yml configuration (i.e. I’m not passing --production) but I’d like to override the admin password.

The configuration lives at camunda.bpm.admin-user.password. Since this is a secret I’d like to pass it in via environment variable. The Spring Boot docs seem to imply this is possible, but I’ve tried a few things that haven’t worked:

docker run -e SPRING_APPLICATION_JSON='{"camunda":{"bpm":{"admin-user":{"password":"boop"}}}}' -p 8080:8080 camunda_bpm_platform:run

-e CAMUNDA_BPM_ADMIN_USER_PASSWORD=boop
-e "CAMUNDA_BPM_ADMIN-USER_PASSWORD"=boop

I’ve also tried appending camunda.bpm.admin-user.password: boop to default.yml before startup, and it looks like the first declaration takes precedence.

Is this possible or am I barking up the wrong tree? Thanks!

The last environment variable override you have there is the closest… the following did the trick for me, just keep in mind the admin user is created shortly after initializing the database on the first run. So you’d have to remove the running container and try again if you don’t get right the first time.

docker run -d --name camunda-run -p 8080:8080 -e CAMUNDA_BPM_ADMIN-USER_PASSWORD=boop camunda/camunda-bpm-platform:run-latest

Thanks for this. I can confirm that passing in the environment variable through Docker as you suggest works. Since - is not a valid character in Bash environment variables I ran into trouble elsewhere, and found that CAMUNDA_BPM_ADMINUSER_PASSWORD worked there (i.e. drop the dash but don’t convert it to an underscore). See the Spring Boot docs for more.