Rednam Nagendra
Rednam Nagendra

Reputation: 363

How to provide application.properties file to spring boot docker image as input

I have spring boot docker image. I provided all arguments(environment variables) in application.properties file. How to provide this file while running the application through docker image as input.

Please help me.

Upvotes: 1

Views: 9038

Answers (1)

Steffen Harbich
Steffen Harbich

Reputation: 2749

You can use docker volumes and start your spring boot application within the docker image like

java -jar /path/to/volume/yourapp.jar --spring.config.location=file:/path/to/volume/application.properties

The application.properties is then externalized to the folder the volume is associated to.

Upvotes: 7

Related Questions