I tried this method: $ export DOCKER_GATEWAY_HOST=172.17.0.1 put a new env docker container: HOST_IP=${DOCKER_GATEWAY_HOST:-host.docker.internal} When the docker runs, it shows HOST_IP=host.docker.internal
$ export DOCKER_GATEWAY_HOST=172.17.0.1
HOST_IP=${DOCKER_GATEWAY_HOST:-host.docker.internal}
$ docker exec <container> env | grep HOST HOST_IP=host.docker.internal
The same is picked up by my python code. Does this (host.docker.internal) also needs to be resolved to get the actual host IP?
host.docker.internal
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I tried this method:
$ export DOCKER_GATEWAY_HOST=172.17.0.1
put a new env docker container:HOST_IP=${DOCKER_GATEWAY_HOST:-host.docker.internal}
When the docker runs, it shows HOST_IP=host.docker.internal
The same is picked up by my python code.
Does this (
host.docker.internal) also needs to be resolved to get the actual host IP?