problem description:
1. I ran my PHP project in the container. At the beginning, the container was bound with 127.0.0.1 8080, but. I accessed through the browser: localhost:8080
did not access the server.
2. Then, in the container, I bind 0. 0. 0. 0. 0. As a result, the server can be accessed through localhost:8080
.
my question is, does the container isolate ip? Through the first step, I feel that the container is isolated from ip, because 127.0.0.1 in the container is isolated from the native 127.0.0.1, so access to the server fails. Therefore, I used 0.0.0.0 in the container. However, for the second step, it seems to be wrong. Because, even if I use 0.0.0.0 in the container, I can access the server in the container with 127.0.0.1 locally. So, is there any quarantine for ip, or not? And how to explain the problems I encountered in the previous two processes?
Screenshot:
1. The services in the container are as follows:
:
2:
:
I hope seniors can help me answer my questions. Thank you!