java - Docker-machine ip in Dockerfile -
i have spring boot project docker. dockerfile this:
...<many useful info>... cmd ["java", "-djava.rmi.server.hostname=<docker_container_ip>", "javafile.jar"]
i need set docker_container_ip (ip of docker container can docker-machine ip default
) when run docker.
how can it?
use environment variables.
https://docs.docker.com/engine/reference/run/#env-environment-variables
docker run -e docker_container_ip=a.b.x.y mycontainer
if need specify them in dockerfile:
https://docs.docker.com/engine/reference/builder/
from someimage env docker_container_ip a.b.x.y
Comments
Post a Comment