简体   繁体   English

在Google Cloud上的Docker图像中运行Jupyter笔记本

[英]Running Jupyter notebook in docker image on Google Cloud

I'm running an Ubuntu 16.04 VM on Google Compute Engine. 我正在Google Compute Engine上运行Ubuntu 16.04 VM。 I've created a static IP address <my_static_ip_address> and my firewall settings allow tcp:80-8888. 我创建了一个静态IP地址<my_static_ip_address> ,我的防火墙设置允许tcp:80-8888。

I started the Jupyter server within the docker image with 我在docker镜像中启动了Jupyter服务器

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

and got this URL 并获得此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? 我无法使用http://<my_static_ip_address>:8888从外部浏览器访问http://<my_static_ip_address>:8888我缺少什么?

I started the Jupyter server within the docker image with 我在docker镜像中启动了Jupyter服务器

What was the docker command you ran? 你运行的docker命令是什么? 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. 然后,docker会将随机主机端口映射分配给容器中的端口8888。 In this case, you can see what port was mapped by running docker ps . 在这种情况下,您可以通过运行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. 该端口将远远高于8888,因此您将无法访问jupyter,因为您的防火墙将阻止流量。

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. 这应该将到达端口8888上的GCE主机的任何流量映射到您的jupyter容器中的端口8888。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 docker 映像运行 jupyter 笔记本时出现问题 - Problem with running jupyter notebook from docker image 使用jupyter笔记本运行docker图像的问题 - problem running docker image using jupyter notebook 在Docker中运行Jupyter Notebook - Running Jupyter notebook in Docker 在计算机睡眠时保持Google Cloud Jupyter Notebook运行 - Keep Google Cloud Jupyter Notebook Running while computer sleeps Jupyter notebook Docker 映像在 Docker 中运行,但不在 Kubernetes 中 - Jupyter notebook Docker image runs in Docker but not in Kubernetes 在 Docker 上的 Anaconda 下运行 jupyter notebook - Running jupyter notebook under Anaconda on Docker 访问运行在 Docker 容器上的 Jupyter notebook - Access Jupyter notebook running on Docker container Jupyter Notebook:访问谷歌云 API - Jupyter Notebook: Access Google Cloud API 无法从在数据proc群集上运行的jupyter笔记本中的Google云存储桶中读取文件 - Unable to read files from google cloud storage bucket from jupyter notebook running on data proc cluster 有没有办法从在 Google Cloud Platform dataproc 集群上运行的 Jupyter 笔记本中的 saved.py 文件中导入和运行函数? - Is there a way to import and run functions from saved .py files in a Jupyter notebook running on a Google Cloud Platform dataproc cluster?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM