Why the port is not working?

Hi,

I’ve got the following running container:

And when I try to open it on localhost:32768 I get an error.

Why?
What do I have to do?

Thank you and best regards

If you can share what error you get, you might get some tips as well.

Yes, no problem.
As a newbie I had no permission in uploading 2 images …

In words (for translation?):

Fehler: Verbindung fehlgeschlagen

Firefox kann keine Verbindung zu dem Server unter localhost:32768 aufbauen.

  • Die Website könnte vorübergehend nicht erreichbar sein, versuchen Sie es bitte später nochmals.*
  • Wenn Sie auch keine andere Website aufrufen können, überprüfen Sie bitte die Netzwerk-/Internetverbindung.*
  • Wenn Ihr Computer oder Netzwerk von einer Firewall oder einem Proxy geschützt wird, stellen Sie bitte sicher, dass Firefox auf das Internet zugreifen darf.*

That’s not a problem as we prefer sharing texts as texts and not as screenshots as text on screenshots are not easy to see . Not to mention I would need to translate your error message to english which I can’t copy this way.

Can you access the service from inside the container? Are you sure it is running and listening on the right port?

After sudo docker ps I get this …

CONTAINER ID   IMAGE                    COMMAND                  CREATED         STATUS                  PORTS                                       NAMES
922f5d788f09   nginx                    "/docker-entrypoint.…"   9 seconds ago   Up 8 seconds            0.0.0.0:32768->80/tcp, :::32768->80/tcp     suspicious_panini

Can you access the service from inside the container?

After sudo docker exec -it 922f5d788f09 bash I am inside (root@922f5d788f09:~#)

Thank you. Now that you shared the first output as text, I can see it is an nginx official image.

I mean’t with curl or wget. I don’t remember which one is available in the nginx container if any, but you can try this:

docker run --rm --network container:suspicious_panini curlimages/curl localhost:80

Use the name of the container which runs nginx if it is not “suspicious_panini” when you try it. Can you also share how you created the container?

1 Like

Thank you, I got it.

Bildschirmfoto 2023-11-17 um 01.15.30

This container is not running on my personal machine, it is running on my server.
So I had to replace 0.0.0.0 with the ip of my server … :see_no_evil:

Sorry, but thank you. :slightly_smiling_face:

That was an important info, but I’m glad you realized it yourself so step-by-step you learn more.