r - 暴露 jupyter 容器的备用端口不起作用
问题描述
我正在尝试在端口 10000 上运行 r-noteb ook ( https://hub.docker.com/r/jupyter/r-notebook/ ) 的 jupyter 容器。
使用命令:
docker run -p 10000:10000 jupyter/r-notebook
这是输出:
Executing the command: jupyter notebook
[I 14:14:28.508 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 14:14:28.954 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
[I 14:14:28.955 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 14:14:28.959 NotebookApp] Serving notebooks from local directory: /home/jovyan
[I 14:14:28.959 NotebookApp] The Jupyter Notebook is running at:
[I 14:14:28.959 NotebookApp] http://(165e94335316 or 127.0.0.1):8888/?token=45a5ff037dfa5dfd8aca69ae8489b4bb814009a9b7f6abf6
[I 14:14:28.959 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:14:28.961 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://(165e94335316 or 127.0.0.1):8888/?token=45a5ff037dfa5dfd8aca69ae8489b4bb814009a9b7f6abf6
从输出:
to login with a token:
http://(165e94335316 or 127.0.0.1):8888/?token=45a5ff037dfa5dfd8aca69ae8489b4bb814009a9b7f6abf6
可以看到端口8888
被暴露而不是10000
我是否正确映射了端口?
在浏览器上访问http://localhost:10000/
或http://127.0.0.1:10000/
或http://165e94335316:10000/
返回“找不到页面”错误。
解决方案
使用docker run -p 10000:8888 jupyter/r-notebook
并访问http://localhost:10000运行它。右侧端口应该是8888
因为所有 Jupyter 笔记本容器都暴露在端口上,如此处8888
所示。
在-p 10000:8888
,8888
是 jupyter notebook 在容器内运行的端口。10000
是在容器中运行的笔记本暴露给主机的端口。
另一个提示:要从http://localhost:8888访问 Jupyter notebook ,请更改10000
为8888
.
docker run -p 8888:8888 jupyter/r-notebook
推荐阅读
- c++ - 将从命令行翻译的库链接到 Make
- html - 未应用 Google 字体。我正在尝试将 Google 字体应用于容器内的文本
- c# - 在 Blazor 组件中使用 for 循环获取 ArgumentOutOfRangeException
- reactjs - 本地服务器问题,启动反应应用程序
- solaris - 如何在 Solaris 中查找和替换字符串?
- xamarin.forms - Xamarin.Forms 使 WebView 可编辑
- python - Python 不读取 unicode U + FE0F
- prolog - 在 findall 中过滤
- javascript - 在 ASP.NET C# 中获取 StackOverFlow 异常
- linux - 如何使用 Gnuplot 5.2 制作多轴图?