【发布时间】:2017-04-22 23:09:00
【问题描述】:
我在运行docker-compose ps时有以下容器:
Name Command State Ports
---------------------------------------------------------------------------------
rainmaker_db_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
rainmaker_python_1 python -u /app/run.py Up 0.0.0.0:5000->5000/tcp
我想在容器rainmaker_python_1中运行jupyther,所以我运行如下命令:
docker-compose exec python jupyter notebook --allow-root
然后我得到以下输出:
[I 23:03:19.168 NotebookApp] Serving notebooks from local directory: /app
[I 23:03:19.168 NotebookApp] 0 active kernels
[I 23:03:19.168 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=35ff0fa9ec171204dbd7542d9c493c760055de24e1b7af18
[I 23:03:19.168 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 23:03:19.169 NotebookApp] No web browser found: could not locate runnable browser.
[C 23:03:19.169 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=35ff0fa9ec171204dbd7542d9c493c760055de24e1b7af18
但是,如果我复制并粘贴链接http://localhost:8888/?token=35ff0fa9ec171204dbd7542d9c493c760055de24e1b7af18,我会发现无法访问该站点。然后我尝试了:
http://localhost:5000/?token=35ff0fa9ec171204dbd7542d9c493c760055de24e1b7af18
但我得到以下信息:
我希望能够执行 jupyter notebook,所以希望有人能帮助我。我几乎没有使用 Docker 的经验。
【问题讨论】:
标签: python docker docker-compose jupyter-notebook jupyter