Answer the question
In order to leave comments, you need to log in
Is it possible to reach localhost from the container?
tried php:7.2-apache image and webdevops/apache-dev:7.2.
Locally, there are a couple of nginx applications that run on port 80. Is it possible to reach them from the container by hostname ? It gives me 404.
Answer the question
In order to leave comments, you need to log in
For the localhost container, this is the container itself, so yes, you can).
To access the parent system, you must use the container's default gateway.
It can be found in two ways, the first is to find out the address on the dockerX interface:
$ ip a | grep docker
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
$ sudo docker exec -it php-fpm sh
/ # ip r | grep default
default via 172.18.0.1 dev eth0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question