Script that checks exposed Docker ports reddit / selfhosted ---------------------------------------------------------------------- angrymaz · 2023-10-06 21:30 I made a simple script that you can run and make sure what port mappings you have and check if they are exposed. [https://github.com/AngryJKirk/docker\_exposed\_ports](https://github. com/AngryJKirk/docker_exposed_ports) ---------------------------------------------------------------------- thekrautboy · 2023-10-06 21:44 Thanks for sharing! But why the need for a script for this? It can be done with a single command directly: docker ps --format '{{.Names}}\t{{.Ports}}' For the basic output. And if you dont want the containers listed that dont have any mapped ports, i guess those are easily excluded with awk or something. Once you have the json output from docker you can do almost anything with it. And then turn that into a alias in .bashrc for example. ---------------------------------------------------------------------- angrymaz · 2023-10-06 21:52 Yeah, that what happens when you try to learn something new and rely on ChatGPT too much :D I will fix everything accordingly so it would at least output everything in a better way. ---------------------------------------------------------------------- thekrautboy · 2023-10-06 21:56 I honestly hate it when people try to learn things from 0 to 100 based on ChatGPT or any other AI stuff. Current AI is very /r/confidentlyincorrect And you only waste your own time with it, and then further on the time of other people who are trying to fix the AI mistakes. Everyone is better off by not using the AI from the start. ---------------------------------------------------------------------- TinyMicron · 2023-10-06 21:59 Cool! Thanks for contributing :) ---------------------------------------------------------------------- NikStalwart · 2023-10-07 01:01 So why would I use this instead of just running `docker ps -a` and checking the port mappings from there? ---------------------------------------------------------------------- Budget-Supermarket70 · 2023-10-07 01:27 Don't need the -a. ---------------------------------------------------------------------- TheRealDave24 · 2023-10-07 18:05 Ridiculous that this is being down voted.