I have a jar file that contains the application.properties file. can we configure the IP address and port number & username & password while running the docker image
Properties file location
App/bin/config/application.properties
Following are the application.properties
driverClassName = org.postgresql.Driver
url = jdbc:postgresql://localhost:5432/sakila
username = root
password = root
entrypoint is the secret.
You have two solutions:
design the image to receive these parameters thru environment variables, and let the ENTRYPOINT injects them inside
App/bin/config/application.propertiesdesign the image to listen to a directory. If this directory contains
*.propertiesfiles, the ENTRYPOINT will collect these files and combine them into one file and append the content withApp/bin/config/application.propertiesBoth solutions have the same Dockerfile
But not the same ENTRYPOINT (myentrypoint)
solution A - entrypoint:
To create a container from this solution :
solution B - entrypoint:
To create a container from this solution :