Docker newbie here.

I am running a node.js utility inside a docker container. This utility is supposed to start a web server, but I don't know if its working.

What can I use to see which ports are open for listening inside a container, so I can expose the appropriate port to my host machine? Normally I would use netstat to check what ports are being listenend on by processes but docker doesn't have netstat.

  • Which host os? On linux you can explicitly nsenter a container to run commands without changing filesystem root. Mar 30 '17 at 21:29
  • The host is Windows 10 Enterprise
    – Joon
    Mar 30 '17 at 21:30

I found this web page: https://linux-audit.com/audit-which-ports-are-used-by-a-linux-process/

It mentions the ss command, which is present in my ubuntu based docker container.

So I was able to find the port by running:

ss -lpntu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.