Are you running that container in Docker Desktop, or in any other virtual machine running on macOS?
Please, also share why you think you were not able to connect. What error message was returned if any? It could be the output of curl as @bluepuma77 suggested,
Starting the tool in a docker terminal as mentioned before, I get something like:
Remote Host: localhost
Local Port: 9999
Open an HTML browser on the remote host and paste this URL in it:
http://localhost:9999/<tool>
Keep this process running and use <ctrl-c> to exit
In a second docker terminal I check the container with ‘docker ps’:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9f234b937e1e <container> "bash" 15 minutes ago Up 15 minutes 0.0.0.0:9999->9999/tcp, [::]:9999->9999/tcp <container>
I am up to today unfamiliar with ‘curl’ (like I am only fairly new to Docker itself ), but all following calls (I ran this from Mac host AND linux docker terminals) return the same error:
If your application really listens only on localhost, it won’t work. It has to listen on all container IP. If it listens only on localhost, it will be available only from localhost. Meaning: inside the container.
You added the “host-network” tag to the topic. I haven’t asked about it until you confirmed you used Docker Desktop. The host network would indeed be an alternative (mainly for testing), but you need to enable it in Docker Desktop and add “--net host” to the docker run command.