0

I am working on docker file with springboot. This line in docker file

ENTRYPOINT ["java", "-Dbootstrap.servers=$DB_PATH","org.springframework.boot.loader.JarLauncher"]

when I run "docker run -p 9000:9000 -e DB_PATH=newvalue imaginename"

I want bootstrap.servers to take value of variable $DB_PATH, however, it will not work and only takes variable name "$DB_PATH"

Or how can i let bootstrap.servers take variables in docker container ? please help.

Thanks

xibrian
  • 85
  • 2
  • 12
  • 1
    Use the shell form, `ENTRYPOINT java -Dbootstrap.servers=$DB_PATH ...`; this will invoke a shell that will do the variable expansion. – David Maze Nov 14 '20 at 00:42
  • @DavidMaze . thanks you mean like this ? ENTRYPOINT java -Dbootstrap.servers=$DB_PATH org.springframework.boot.loader.JarLauncher – xibrian Nov 14 '20 at 00:48
  • it works. you saved my date. thank you so much...........!!!!!!!!!!!! – xibrian Nov 14 '20 at 00:51

0 Answers0