user6115382
user6115382

Reputation: 33

Having difficulty accessing the Jupyter notebook when trying to run TensorFlow through Docker

My problem:

Newbie to the ML field here. I am currently attempting to set up tensorflow through docker but am having some troubles getting to the jupyter notebook once tensorflow appears to be running. For future reference, I am using windows 10, powershell, python 2.7, and oracle virtualbox (v.5.0.16).

I am pretty confident that docker is working properly because I went through their setup tutorial ("Using docker from Powershell") without any issues--I was able to run the hello world example there just fine. I was also able to successfully run an ubuntu terminal with the command

docker run -it ubuntu bash

I then followed the tensorflow docker installation instructions and everything appeared to be normal--I entered the docker run command for tensorflow:

docker run -it b.gcr.io/tensorflow/tensorflow

and got this output:

[I 19:33:16.330 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 19:33:16.360 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[W 19:33:16.360 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using authentication. This is highly insecure and not recommended.
[I 19:33:16.365 NotebookApp] Serving notebooks from local directory: /notebooks
[I 19:33:16.365 NotebookApp] 0 active kernels
[I 19:33:16.365 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/
[I 19:33:16.366 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

However, when I attempt to get to the jupyter notebook at localhost:8888, chrome says the site cannot be reached within a few seconds and that the server refused to connect.

Solutions I have tried:

I appreciate any and all help that is offered. Please let me know if anything I stated is vague, or if I can offer any more details on what I have tried. Thank you very much in advance.

Upvotes: 3

Views: 3983

Answers (2)

MMalke
MMalke

Reputation: 2116

Try adding -p 8888:888 to the docker run command.

docker run -p 8888:8888 -it b.gcr.io/tensorflow/tensorflow

Found the solution in this tensorflow issue, in a comment by HWiese1980

Since Docker usually needs to have the same operating system on the Docker host system as it's in the Docker container (well, parts that is) you need a Linux VM to run a Docker container that is based on Linux under Windows. Docker itself opens port 8888 between the VM and the container. You have to explicitly tell it to forward the port from the outside of the VM to the open Docker container port by using said parameter -p 8888:8888.

Upvotes: 2

Malith
Malith

Reputation: 805

For ubuntu 14.04 I had to use the below command to specify '/bin/bash' so that it would enter the interactive console.

docker run -it gcr.io/tensorflow/tensorflow /bin/bash

Upvotes: 1

Related Questions