0

I need to create my docker container that I generate with my Jhipter application (maven, spring-boot). If I pass parameters dynamically by console, Works correctly:

./mvnw -Pprod -Dspring-boot.run.arguments=--spring.data.mongodb.database="zzasets-0001",spring.data.mongodb.uri="mongodb://192.168.1.136:27017"

On the other hand, creating my docker image makes me perfectly

./mvnw package -Pprod verify jib:dockerBuild

I have the problem when I want to create the docker container with my dynamic parameters. I did not take them and although it does not give error, it does not incorporate it into the image that it creates

./mvnw package -Dspring-boot.run.arguments=--spring.data.mongodb.database="zzasets-prueba",spring.data.mongodb.uri="mongodb://192.168.1.136:27017" verify jib:dockerBuild
Jose
  • 1,779
  • 4
  • 26
  • 50
  • Do you want the bake the system property `-Dpsring-boot.run.arguments` into the Docker image (i.e., statically embedded and fixed) or want to provide the property dynamically at runtime? If former, I remember JHipster has `entrypoint.sh` somewhere, and you could put it the property there? – Chanseok Oh Nov 19 '19 at 18:52
  • ```#!/bin/sh echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} exec java ${JAVA_OPTS} -noverify -XX:+AlwaysPreTouch -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* "io.wizzie.zzassets.ZzassetsApp" "$@" ``` The contents of the "entrypoint.sh" file, you can give me more detail on how to incorporate my maven arguments. Thank you very much. – Jose Nov 20 '19 at 07:44
  • I think you can just put `-Dspring-boot.run.arguments=...` in between `java` and `${JAVA_OPTS}`. The system property `spring-boot.run.arguments` will be available to the JVM. – Chanseok Oh Nov 20 '19 at 20:55

0 Answers0