Zin Yosrim
Zin Yosrim

Reputation: 1684

Running Jupyter notebook in docker image on Google Cloud

I'm running an Ubuntu 16.04 VM on Google Compute Engine. I've created a static IP address <my_static_ip_address> and my firewall settings allow tcp:80-8888.

I started the Jupyter server within the docker image with

jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root

and got this URL

http://0.0.0.0:8888/?token=8b26c453d278eae1da71b80f26a4ef8ea06734e5c636d897

I'm not able to access from external browser with http://<my_static_ip_address>:8888 What am I missing?

Upvotes: 2

Views: 1936

Answers (1)

bluescores
bluescores

Reputation: 4677

I started the Jupyter server within the docker image with

What was the docker command you ran? A common gotcha here would be not mapping a host port to a container port.

For example, if you did this:

docker run -p 8888 jupyter/notebook

Then docker would assign a random host port mapping to port 8888 in the container. In this case, you can see what port was mapped by running docker ps. The port will be much higher than 8888 though, so you won't be able to reach jupyter because your firewall will block the traffic.

What you probably want to do is go ahead and map a host port like so:

docker run -p 8888:8888 jupyter/notebook

This should map any traffic reaching the GCE host on port 8888 to port 8888 in your jupyter container.

Upvotes: 3

Related Questions