Related to question Docker and netstat: netstat is not showing ports, exposed by docker containers where only solutions are discussed, I would like to know why this happens?
What happens:
If I serve a service using docker (e.g. docker run --rm -p 8080:80 httpd
), executing netstat -anp | grep 8080
on host shows docker listening on 8080, but it does not show open connections! I would expect to see connections also on host, because clients are connected to the host which forwards the port to the docker container.
Why is it not possible to see these connections?