For Mac (if no
PORT=8080 sudo lsof -n -i4TCP:$PORT | grep LISTEN sudo lsof -n -iTCP:$PORT | grep LISTEN sudo lsof -n -i:$PORT | grep LISTEN
For Linux (if no
netstat -tulpn | grep $PORT
To see network info for Docker host, use the
network (v1.9+) command:
docker network [OPTIONS] COMMAND [OPTIONS]
To link containers by name, you now need to use the –link command:
docker network inspectcommand above shows all the connected containers and their network resources on a given network. Containers in this default network are able to communicate with each other using IP addresses. Docker does not support automatic service discovery on the default bridge network. If you want to communicate with container names in this default bridge network, you must connect the containers via the legacy
docker run --linkoption.
If you upgraded your Docker host from pre 1.9 and your containers were not longer able to communicate, this is probably why.
$ docker run --rm -ti busybox ping my-container ping: bad address 'my-container' $ docker run --rm -ti --link=my-container busybox ping my-container PING my-container (172.17.0.2): 56 data bytes ...
While links are still supported in this limited capacity, you should avoid them in preference of Docker networks. The link feature is expected to be deprecated and removed in a future release.
See specific table rules for iptables — otherwise
filter table is used. Add
-v for more info.
iptables --table nat --list