I've a question about docker containers and sockets. Today i've discovered that, docker containers with mapped port
-p 80:80 (or etc ports) on the host system, doesn't show up when i use
lsof -i (also tried with
sudo, no chance). Then i tried to test, open a listener port 80 with
sudo nc -l -p 80, but no chance, it refused to connect port 80, although this port doesn't show up opened by some process.
I think this problem occurs due to containerization or network namespaces, but there are should be some commands to list used sockets by low level, kernel level?
p.s: When i tried to use docker host network interface ip address on port mapping (
-p 172.17.0.1:80:80), it showed up using above commands.
lsof | grep -w 80 output:
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete. Xorg 718 root 37u CHR 13,80 0t0 10891 /dev/input/event16 Xorg 718 749 Xorg:disk root 37u CHR 13,80 0t0 10891 /dev/input/event16 Xorg 718 778 Xorg:disk root 37u CHR 13,80 0t0 10891 /dev/input/event16 Xorg 718 787 Xorg:disk root 37u CHR 13,80 0t0 10891 /dev/input/event16 Xorg 718 841 InputThre root 37u CHR 13,80 0t0 10891 /dev/input/event16