as the title
first of all, I iptables-F cleared all the rules
then I created a project with express-generator
, test, went into it and created a Dockerfile, to make it easier for me to npm install all the packages I needed directly
curl http://172.17.0.2:3000
-sharp <!DOCTYPE....
curl http://192.168.2.2:3000
-sharp <!DOCTYPE....
there should be no problem to run.
but I can"t access it using other machines on the same local area network (such as 2.5or 2.7s), and I docker logs check that there is no access information at all.
before using docker, I tested direct access to other machines on native npm start. No problem. I don"t understand why this happened. Help!
within docker
ip a
1: lo: <LOOPBACK.....
4: eth0@if5: <BROADCAST, MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0
valid_lft forever preferred_lft forever
ip r
default via 172.17.0.1 dev eth0
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.2.0/24 dev eno1 proto kernel scope link src 192.168.2.115
192.168.2.254 dev eno1 proto shcp scope link src 192.168.2.115 metric 100
docker container ls
7c... mariadb "docker-entrypoint.s..." 12 days ago up 6 minutes 0.0.0.0:3306->3306/tcp
Systems outside Docker
ip a
eno1 192.168.2.0DHCPIP
docker0: <BROADCAST, MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:11:87:74 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
inet 6 ................ scope link
valid_lft forever preferred_lft forever
ip r
default via 192.168.2.254 dev eno1 proto dhcp src 192.168.2.127 metric 100
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
192.168.2.0/24 dev eno1 proto kernel scope link src 192.168.2.115
192.168.2.254 dev eno1 proto dhcp scope link src 192.168.2.127 metric 100