0

is it possible to get the docker host IP inside the java program running in the docker container?

2
  • Hi, welcome to stack overflow. Please refer the How to Ask link for more details on how to ask a question and update your question accordingly. Commented Apr 18, 2018 at 3:52
  • @JeroenHeier The question sounds a bit like an X-Y problem, but other than that I don't think there is anything wrong with it. Commented Apr 18, 2018 at 3:55

1 Answer 1

1

From my understanding that docket from it’s initial design is to isolate the host from containers. Although this is doable, such as passing in a env variable to the container at startup, it is not a good practice. Try to containerize everything, and use a network and network links instead. [Docker Compose maybe helpful]

If you really need to do so for whatever reason here is a link for reference

How to get the IP address of the docker host from inside a docker container

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.