无法从Docker访问Jupyter Notebook [英] Can't access jupyter notebook from docker

查看:136
本文介绍了无法从Docker访问Jupyter Notebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行在Docker中创建的jupyter笔记本。



首先我运行一个容器:

  docker run -p 8888:8888 jupyter / tensorflow-notebook 

我得到的是:

  [I 19:44:47.140 NotebookApp]将笔记本服务器cookie秘密写到/ home / jovyan / .local / share / jupyter / runtime / notebook_cookie_secret 
[I 19:44:51.731 NotebookApp]从/opt/conda/lib/python3.7/site-packages/jupyterlab
[I 19 :44:51.732 NotebookApp] JupyterLab应用程序目录为/ opt / conda / share / jupyter / lab
[I 19:44:51.742 NotebookApp]从本地目录提供笔记本:/ home / jovyan
[I 19 :44:51.743 NotebookApp] Jupyter Notebook运行在:
[I 19:44:51.743 NotebookApp] http://(c693a40d34b7或127.0.0.1):8888 /?token = 2e31ab3088fcf6a707480d456152c993606f26164fcc99ab
[I 19:44:51.743 NotebookApp]使用Control-C停止该服务器并关闭所有内核(两次o跳过确认)。
[C 19:44:51.753 NotebookApp]

要访问笔记本,请在浏览器中打开此文件:
file:///home/jovyan/.local/share /jupyter/runtime/nbserver-6-open.html
或复制并粘贴以下网址之一:
http://(c693a40d34b7或127.0.0.1):8888 /?token = 2e31ab3088fcf6a707480d456152c993606f26164fcc99ab

但是当我尝试在Chrome上打开Jupyter笔记本时:

  file:///home/jovyan/.local/share/jupyter/runtime/nbserver-6-open.html 

http:// c693a40d34b7 :8888 /?token = 2e31ab3088fcf6a707480d456152c993606f26164fcc99ab

达到。我在做什么错?

解决方案

我要做的就是使用命令获取docker-machine的IP地址:

  docker-machine ip 

然后使用我得到的IP代替命令中给出的IP:

 或复制并粘贴一个这些网址中的一个:
http://(c693a40d34b7或127.0.0.1):8888 /?token = 2e31ab3088fcf6a707480d456152c993606f26164fcc99ab


I am trying to run a jupyter notebook created in Docker.

Firstly I run a container:

docker run -p 8888:8888 jupyter/tensorflow-notebook

What I get is:

[I 19:44:47.140 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 19:44:51.731 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
[I 19:44:51.732 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 19:44:51.742 NotebookApp] Serving notebooks from local directory: /home/jovyan
[I 19:44:51.743 NotebookApp] The Jupyter Notebook is running at:
[I 19:44:51.743 NotebookApp] http://(c693a40d34b7 or 127.0.0.1):8888/?token=2e31ab3088fcf6a707480d456152c993606f26164fcc99ab
[I 19:44:51.743 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 19:44:51.753 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///home/jovyan/.local/share/jupyter/runtime/nbserver-6-open.html
    Or copy and paste one of these URLs:
        http://(c693a40d34b7 or 127.0.0.1):8888/?token=2e31ab3088fcf6a707480d456152c993606f26164fcc99ab

But when I try to open Jupyter notebook on Chrome:

file:///home/jovyan/.local/share/jupyter/runtime/nbserver-6-open.html
or
http://c693a40d34b7:8888/?token=2e31ab3088fcf6a707480d456152c993606f26164fcc99ab

It is written that file was not found or that site can't be reached. What am I doing wrong?

解决方案

What I had to do was to get ip address of the docker-machine using command:

docker-machine ip

Then use the ip I got instead of the one given in the command:

Or copy and paste one of these URLs:
    http://(c693a40d34b7 or 127.0.0.1):8888/?token=2e31ab3088fcf6a707480d456152c993606f26164fcc99ab

这篇关于无法从Docker访问Jupyter Notebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆