Docker Community Forums

Share and learn in the Docker community.

Port not opening in FireFox

I followed the instructions for installing & running docker on Ubuntu 20.04 (I’m using VirtualBox with Windows 10 host) at How to Install Docker and Run Docker Containers in Ubuntu - all went well.

At quickchart/Dockerfile at master · typpo/quickchart · GitHub it says EXPOSE 3400 but still I gave -p 3400:3400

sudo docker run ianw/quickchart -p 3400:3400 which runs properly - no errors

But localhost:3400 doesn’t connect.

Any idea why ? Is it because all my docker commands are using sudo ?

PS : I know the docker is running successfully because when I do sudo docker exec -it 6108092937ef wget http://localhost:3400 it says saving to ‘index.html’ 100%|************

You just passed the port mapping to the node command inside the container. Docker didn’t get the port mapping. Anything after the image name is executed inside the container or passed to the entrypoint as an argument. In your case that is node and -p for node means “evaluate script and print result”.

This will work:

sudo docker run  -p 3400:3400 ianw/quickchart
1 Like

Thank you so much, I totally missed this. Thanks again.