Rug*_*nar 4 docker jupyter-notebook
我想将 jupyter Notebook 安装到我的 docker 映像中。在容器中安装并运行它后,我无法从浏览器访问它。
\n这是我的最小设置:
\nDockerfile:
\nFROM python:3.7.5\nRUN pip install jupyterlab\nEXPOSE 8888\nCMD jupyter-lab --allow-root\nRun Code Online (Sandbox Code Playgroud)\n命令
\nFROM python:3.7.5\nRUN pip install jupyterlab\nEXPOSE 8888\nCMD jupyter-lab --allow-root\nRun Code Online (Sandbox Code Playgroud)\n容器输出:
\n To access the server, open this file in a browser:\n file:///root/.local/share/jupyter/runtime/jpserver-7-open.html\n Or copy and paste one of these URLs:\n http://localhost:8888/lab?token=e6b9a5dd573aabc52e6753e7b21f0daf6270e685055afa50\n or http://127.0.0.1:8888/lab?token=e6b9a5dd573aabc52e6753e7b21f0daf6270e685055afa50\nRun Code Online (Sandbox Code Playgroud)\n我尝试打开这些链接中的任何一个,并在浏览器中收到此消息:
\nThis page isn\xe2\x80\x99t working\nlocalhost didn\xe2\x80\x99t send any data.\nERR_EMPTY_RESPONSE\nRun Code Online (Sandbox Code Playgroud)\n我究竟做错了什么?
\n小智 7
默认情况下,Jupyter 配置为仅侦听 localhost 接口,您需要将其配置为侦听 0.0.0.0 (容器的 localhost 不是您的主机 localhost ..)
将CMDDockerfile 中的行更改为CMD jupyter-lab notebook --ip 0.0.0.0 --port 8888 --allow-root
或jupyter_notebook_config.py在容器/图像中编辑:更改以to
开头的行
并更改以to开头的行c.NotebookApp.allow_originc.NotebookApp.allow_origin = '*'c.NotebookApp.ipc.NotebookApp.ip = '0.0.0.0'
使用这个问题寻求帮助:Why I can't access Remote Jupyter Notebook server?
| 归档时间: |
|
| 查看次数: |
2487 次 |
| 最近记录: |