Pass command line args to Java app (Spring Boot) running in Docker
You can try to modify your ENTRYPOINT
in your Dockerfile
like that:
ENTRYPOINT exec java -jar -Dspring-boot.run.arguments=--greeting=Hello,--recipient=World
Or you can pass argument at run:
docker run -p 8080:8080 test-image --recipient="World"--greeting="Hello"
You can provide all command line arguments just after name of your docker image in run
command.
Example:
docker run -p 8080:8080 test-image --recipient="World"--greeting="Hello"