简体   繁体   English

在Docker中运行Jupyter Notebook

[英]Running Jupyter notebook in Docker

I want to run jupyter in docker container. 我想在docker容器中运行jupyter。 I am not able to launch the jupyter notebook. 我无法启动jupyter笔记本。 When I copy paste the URL given in the terminal.. server cannot be reached. 当我复制粘贴时,无法访问终端服务器中给定的URL。 Will appreciate any ideas to try 将不胜感激尝试的任何想法

在此处输入图片说明

You are forwarding port 8080 in the docker run call with -p 8080:8080 . 您正在使用-p 8080:8080docker run调用中转发端口-p 8080:8080 But you also need to forward port 8888 by adding -p 8888:8888 . 但是您还需要通过添加-p 8888:8888转发端口-p 8888:8888 More specifically, you want to run: 更具体地说,您要运行:

docker -it -p 8080:8080 -p 8888:8888 jupyter/minimal-notebook

First thing is Jupyter nootbook runs on port 8888. If you want to access the notebook on a diff port on your host you should map it like this -p 80:8888. 首先是Jupyter nootbook在端口8888上运行。如果要在主机上的diff端口上访问笔记本,则应按-p 80:8888的方式映射它。

If you don't mind using the defaults, you should use run the following command. 如果您不介意使用默认值,则应使用运行以下命令。 Run this command: docker run -p 8888:8888 jupyter/minimal-notebook . 运行以下命令: docker run -p 8888:8888 jupyter/minimal-notebook Then 然后

replace the host name in the url given in terminal with localhost like this http://localhost:8888/\\?token\\=<TOKEN>\\&token\\=<TOKEN> 用localhost替换终端在终端提供的URL中的主机名,例如http://localhost:8888/\\?token\\=<TOKEN>\\&token\\=<TOKEN>

This should work. 这应该工作。

Note: If you map it to a diff port, you should replace it in the url you get in the terminal. 注意:如果将其映射到差异端口,则应将其替换为从终端获得的URL。 Ex. 防爆。 http://localhost:80/\\?token\\=<TOKEN>\\&token\\=<TOKEN>

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM