【发布时间】:2019-07-01 12:25:33
【问题描述】:
我在建立从本地计算机到我在 docker 容器中的远程服务器上运行的 jupyter notebook 实例的连接时遇到问题。
到目前为止我做了什么:
我用ssh username@remoteHostIp连接到远程服务器
我运行 docker container ls 以确保我的容器尚未运行
现在我用docker run -it -p 8888:8888 -p 6006:6006 -v ~/:/host waleedka/modern-deep-learning启动我的容器
我现在在我的容器中使用终端并启动一个无浏览器的 jupyter notebook 实例
jupyter notebook --no-browser --port=8889 --allow-root
启动成功:
The Jupyter Notebook is running at:
[I 11:14:51.979 NotebookApp] system]:8889/
现在我在本地计算机上启动另一个 shell 并创建一个 ssh 隧道:
ssh -N -f -L localhost:8888:localhost:8889 username@ remote_host_name
我的 shell 几秒钟后返回以下内容:
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
我无法通过 localhost:8888/ 或 localhost:8889/ 访问 jupyter notebook
当我在 docker 容器外的远程服务器上运行 jupyter notebook 并创建 ssh 隧道时,一切正常。
一些附加信息: 远程服务器: 经销商编号:Ubuntu 说明:Ubuntu 16.04.3 LTS 发布时间:16.04 代号:xenial
我的本地机器在 osx moave 上运行
【问题讨论】:
-
我也找到了这个this 线程,但我不确定这对我的问题有什么帮助,
-
感谢您的回答,但以下命令对我不起作用。
jupyter notebook --no-browser --port=8889 --allow-root。一旦使用 --ip 0.0.0.0 运行它就可以正常工作。jupyter notebook --ip 0.0.0.0 --port=8889 --allow-root
标签: docker jupyter-notebook ssh-tunnel