Created
May 3, 2019 11:22
-
-
Save jmhale/9c2e8068f0e6173fff613a4ac2031445 to your computer and use it in GitHub Desktop.
Gets listening ports inside of a Docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONTAINER_PID=$(sudo docker inspect -f '{{.State.Pid}}' container_name; sudo nsenter -t $CONTAINER_PID -n netstat -ln | grep LISTEN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment