I've installed the tensorflow docker container on an ubuntu machine. The tensorflow docker setup instructions specify:
docker run -it b.gcr.io/tensorflow/tensorflow
This puts me into the docker container terminal, and I can run python and execute the Hello World example. I can also manually run .\run_jupyter.sh to start the jupyter notebook. However, I can't reach the notebook from host.
How do I start the jupyter notebook such that I can use the notebook from the host machine? Ideally I would like to use docker to launch the container and start jupyter in a single command.
These steps worked for me if you are a total docker noob using a windows machine.
Versions: Windows 8.1, docker 1.10.3, tensorflow r0.7
docker-machine ip
and make a note. Lets call it 'ip address'. Will look something like this: 192.168.99.104 (I made up this ip address)Paste this command on the docker terminal:
docker run -p 8888:8888 -p 6006:6006 b.gcr.io/tensorflow/tensorflow
.If you are running this for the first time, it will download and install the image on this light weight vm. Then it should say 'The Jupyter notebook is running at ....' -> This is a good sign!
<your ip address (see above)>:8888
. Eg. 192.168.99.104:8888/Jupyter now has a ready to run Docker image for TensorFlow:
docker run -d -v $(pwd):/home/jovyan/work -p 8888:8888 jupyter/tensorflow-notebook
For some reason I ran into one additional problem that I needed to overcome beyond the examples provided, using the
--ip
flag:And then I can access via http://localhost:8888 from my machine. In some ways this makes sense; within the container you bind to
0.0.0.0
which represents all available addresses. But whether I need to do this seems to vary (e.g I've started notebooks usingjupyter/scipy-notebook
without having to do this).In any case, the above command works for me, might be of use to others.