Docker Community Forums

Share and learn in the Docker community.

Unable to Open Container in Jupyter Notebook


I am very new to Docker, so I apologize if my terminology is a little off (still trying to get a full understanding). My OS version is 10.15.5 and Docker version is 19.03.8.

The issue has a few parts to it, but the main problem is that when I run my container then try to open a Jupyter notebook, the token URL does not work when pasted into my browser. On Chrome, I get an error that says “This site can’t be reached. localhost refused to connect.”. On Safari, the error is “Safari can’t connect to the server. Safari can’t open the page because Safari can’t connect to the server ‘localhost’.”

The exact steps I took are below:

  • In terminal, I pull the image I need with the command “docker pull madslupe/hddm”

  • Once the pull completes, I run it with the command “docker run -i -t madslupe/hddm /bin/bash”

  • This changes my terminal prompt to jovyan@04d0d4b64c97:~$ and shows the container running in the Docker Desktop dashboard

  • In terminal still, I enter “jupyter notebook”, which outputs the URL to be copied.

  • I copy the URL from either terminal or the log on the dashboard then paste into my browser. Then, I get the error.

When my colleague follows the same steps, it successfully opens the appropriate notebook without error. There are a few differences we’ve noticed that might help explain the difference, but I’m not sure. For one, he has an extra button on the dashboard that I do not: “Open in Browser”. Next to my containers, I have only four buttons (CLI, Start, Restart, Delete). Second, every time he stops then starts running a container through the dashboard (using the buttons), he gets a new token/URL. When I stop then start or restart a container, I get no output except for an exit line after each stop.

I have tried restarting my device, deleting then reinstalling Docker, and cleaning/purging data from Docker then starting over.

Any help would be greatly appreciated, thank you!