docker - 从 Docker : curl: (56) Recv failure: Connection reset by peer 运行 Jupyter Notebook

标签 docker jupyter-notebook

我有一个简单的 Dockerfile

FROM ubuntu:latest

RUN pip install cython jupyter

EXPOSE 8888 4040

CMD ["jupyter", "notebook", "--ip=127.0.0.1", "--port=8888", "--allow-root", "--no-browser"]

我构建它并启动一个这样的容器:
docker container run -d -p 8888:8888 -p 4040:4040 --name test_run my_custom_image

然后我检查日志以获取 jupyter 登录 token :
docker container logs test_run
...
Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://127.0.0.1:8888/?token=7bf22f85e7b942b9936b1403523ba8c334a62bdd278376fc

然后我尝试 curl 链接,但我得到了这个:
curl http://127.0.0.1:8888/tree?token=7bf22f85e7b942b9936b1403523ba8c334a62bdd278376fc

curl: (56) Recv failure: Connection reset by peer

如果我运行 docker container exec -it test_run bash并从那里运行 curl,它正在工作

运行 netstat -tupln在主机上:
tcp6       0      0 :::8888                 :::*                    LISTEN      

运行 netstat -tupln在容器中:
tcp        0      0 127.0.0.1:8888          0.0.0.0:*               LISTEN      1/python

有小费吗?

最佳答案

更改了 --ip=127.0.0.1--ip=0.0.0.0它解决了我的问题..

关于docker - 从 Docker : curl: (56) Recv failure: Connection reset by peer 运行 Jupyter Notebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55700517/

相关文章:

python - 模块化 Jupyter notebook 序言

postgresql - Docker-Compose + postgres : database and user creation not working (works without compose)

python - 如何为Docker容器分配更多内存?

docker - 如何在 Airflow 上运行 DockerOperator?

docker - 如何使用docker参数作为其内部函数的参数

python-3.x - 在 Github 中设置 jupyter-notebook "Binder"

nginx - 使用HAproxy在Mesos集群中负载均衡Docker容器

SSL:WRONG_VERSION_NUMBER 设置公共(public) Jupyter 服务器时

ssh - 远程使用 Jupyter notebook 调试端口转发

python - Jupyter Notebook 时间分析