访问在 unix 服务器上安装的 Docker 容器上运行的 jupyter

时间:2021-06-10 12:30:07

标签: python docker docker-compose jupyter-notebook containers

这是我在 docker 上工作的第一周,我开始了我的新工作,发现在服务器上运行容器,在这个容器上 我已经安装了 jupyter。 ps:我不知道我的容器在哪个端口上运行,代码中没有暴露。

我无法从本地主机访问 jupyter。

我做到了:

#Acess server
ssh data_team@word-server-prod
# on server
docker ps
f04ccccccc7        registry.gitlab.com/world/jupyter_project:9ad9XXXXXXXXXXXXXXXXXXXXXXXXXXX8   "/bin/bash -c '/usr/"   12 weeks ago         Up 12 weeks                                    jupyter_project
#  
# access to container
docker container exec -it f04ccccccc7 bash
#inside container
jupyter notebook --ip 0.0.0.0 --no-browser --allow-root
**i got**
http://127.0.0.1:8889/?token=16125997dXXXXXXXXXXXXXXXXXXXXXXXXXX24cd5d99
**from server i did**
curl http://127.0.0.1:8889/?token=16125997dXXXXXXXXXXXXXXXXXXXXXXXXXX24cd5d99

我得到了 curl: (7) 无法连接到 127.0.0.1 端口 8889:拒绝连接

0 个答案:

没有答案