84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
我的Dockerfile里暴露的缺失是3000端口,运行下面指令:
docker run -P -d --name myexpress alpha/express
查看结果如下:
可我尝试访问:localhost:32768,没有结果。但是我登进虚拟机,curl端口3000是有结果的。
所以目前我的情况是:容器内的应用(Express)跑起来了,可外部访问不到,我觉得是端口映射出问题了。各路大神,给我出出主意吧。
学习是最好的投资!
If you want to look at it this way on a mac, there is a container management software called kitematic,
It seems there is a problem with the service binding address. Binding 127.0.0.1 may not receive requests from external IPs.
127.0.0.1 is a loopback address, which can only be accessed locally and cannot be accessed externally. So your express needs to monitor the address 0.0.0.0
-p IP address: host port: IP address: container port/protocol
If you want to look at it this way on a mac, there is a container management software called kitematic,
It seems there is a problem with the service binding address. Binding 127.0.0.1 may not receive requests from external IPs.
127.0.0.1 is a loopback address, which can only be accessed locally and cannot be accessed externally. So your express needs to monitor the address 0.0.0.0
-p IP address: host port: IP address: container port/protocol