Can't access forwarded port on Play With Docker suggested in the Getting started tutorial

  • The connection times out before displaying the To Do app on labs.play-with-docker.com
  • It does work fine on localhost:3000/ when I run it locally.
  • I have tried this on Pop_OS! and on MacOS Sonoma 14.4 (Intel chip)
  • I have tried this on two separate networks to rule out IT as a problem. DNS is perfect.
  • There are a lot of different versions that pop up when I type “docker version”, but I’ve tried it on client version 25.03 and 25.04, as well as Docker Desktop 4.27.2 and 4.28.0

Steps to reproduce:

  1. Go to https://labs.play-with-docker.com/
  2. docker run -dp 0.0.0.0:3000:3000 fuhrmaaj/getting-started
  3. After it’s done pulling, click on the port 3000 link that pops up.
  4. Despair.

I copy and pasted the content of the Dockerfile into a file called Dockerfile and placed it in the same level as package.json. It does not have a file extension and it does have a Docker icon on it in my VSCode, which seems promising. I’m a little confused as to why there’s a line that says “WORKDIR /app” when there isn’t a /app directory, but it works fine locally so I trust it.

I have removed all images and containers from my local devices. I ran:

docker build -t getting-started . # in the path/to/getting-started-app

docker tag getting-started fuhrmaaj/getting-started

docker push fuhrmaaj/getting-started

I see it on dockerhub, it says the “latest” tag is getting pushed and pulled. I tried changing the IP of the docker run on PWD to 3000:80, and opening both 80 and 3000. I’m super stumped and would love if anybody can see what I’m doing wrong.

Works for me with plain Docker:

docker run --rm -p 3000:3000 fuhrmaaj/getting-started

I can access it with http://<IP>:3000.

If you use Docker Desktop, check how you can expose the port outside of the Docker Desktop VM. Make sure you use the right IP.

Thank you so much for trying this out for me. At least that means that something was done right!

I am able to get it to run locally, but I can’t get it to work on lab.play-with-docker.com. Can you confirm that you were able to get it to run on the PWD?

I wouldn’t run an image I don’t know from someone I don’t know (sorry, I’m that paranoid :slight_smile: ), but if the container and its port works locally, then it doesn’t matter what we try on play with Docker, so I tried a simple official HTTPD image. Accessing the port didn’t work for me either. You could click on the “Give a feedback” button and report it, but someone else already did it on GitHub

Hey man, I was thinking about that when I posted it and it totally makes sense that you don’t feel safe running it. It’s a bummer that I can’t click a button on Docker to share the source code with you!

Thank you for trying it out, I’m definitely going to give them some feedback! It’s too bad I’ve spent two days trying to get this to work though =/

I’m not sure what you mean by “button on Docker”, but you could share the source code following this guide: How to format your forum posts

which is the same way as on almost every IT support forum :slight_smile: But that’s not the point, I could download the image, and check the content without sharing the code here. I actually did it, but I wouldn’t spend more time on understanding the code, when it is not really neccessary :slight_smile:

I hope they fix “Play with Docker” soon, but can you share what you like in PWD that you can’t do locally? Or do you want to share the links or do you want to try Docker CE when you have Docker Desktop locally?

PS.: I’m going to change the topic title to describe the actual problem better.

True, I didn’t think about the risk my image represented until a couple hours after posting so I didn’t think to share the code. But as you said, the problem isn’t really with the code, it seems to be with PWD and knowing that other people are having trouble getting anything to work helps me a lot.

This is my first experience with software containers and with Docker. So I don’t have any like or affinity with PWD, it was just what the Docker docs told me to use in the getting started guide here: Share the application | Docker Docs

I’m happy to run it locally and it seems to work. I just thought that if it wasn’t working on PWD, then maybe there was something I was missing about how to use Docker that would prevent me from deploying anything serious on it. I’ll keep working through the tutorial and thank you so much for the response.

Also, thank you for changing the title.

I see. Then thank you for reporting it.

Hi, this is fixed already in PWD. Sorry for the inconvenience :pray:

2 Likes

Hey, I just tested it and it works now! Thank you so much!