How to get environment variable in docker with springboot?

I want get my database setting like DB_HOST with environment variable

my repo is GitHub - hezhongfeng/authorization-server: authorization-server


If you’re looking to use a environment variable in a Docker build, you would need to refer to these docs:

Alternatively, if you’re referencing the environment variable at runtime, it would be available without any further configuration.


Thanks for tour answer.I have used secret file .env to set database’s info.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.