gpt4 book ai didi

docker - 无法从 docker 访问 jupyter notebook

转载 作者:行者123 更新时间:2023-12-02 18:19:27 31 4
gpt4 key购买 nike

我正在尝试运行在 Docker 中创建的 jupyter notebook。

首先我运行一个容器:

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

我得到的是:
[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

但是当我尝试在 Chrome 上打开 Jupyter notebook 时:
file:///home/jovyan/.local/share/jupyter/runtime/nbserver-6-open.html
or
http://c693a40d34b7:8888/?token=2e31ab3088fcf6a707480d456152c993606f26164fcc99ab

写入文件未找到或无法访问该站点。我究竟做错了什么?

最佳答案

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

docker-machine ip

然后使用我得到的ip而不是命令中给出的ip:
Or copy and paste one of these URLs:
http://(c693a40d34b7 or 127.0.0.1):8888/?token=2e31ab3088fcf6a707480d456152c993606f26164fcc99ab

关于docker - 无法从 docker 访问 jupyter notebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57064541/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com