Skip to content

Instantly share code, notes, and snippets.

@jmhale
Created May 3, 2019 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmhale/9c2e8068f0e6173fff613a4ac2031445 to your computer and use it in GitHub Desktop.
Save jmhale/9c2e8068f0e6173fff613a4ac2031445 to your computer and use it in GitHub Desktop.
Gets listening ports inside of a Docker container
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