Docker容器開jupyter不能訪問到的解決方法
在本項目中使用了docker容器搭建環境,Dockerfile 如下:
FROM tensorflow/tensorflow:1.14.0-gpu-py3RUN pip install scipy==1.3.3RUN pip install requestsRUN pip install PillowRUN pip install matplotlibRUN pip install pandasRUN pip install keras==2.2.4RUN pip install scikit_learn==0.20.0RUN pip install transformers==3.5.0
創建docker容器:
sudo docker build - < Dockerfile
創建成功之后給打上標簽:
docker tag a7a1861d2150 datascience/text2animeface:v0.1
然后進入容器:
sudo docker run --gpus all -it -p 8080:8080 -p 8888:8888 -d -v `pwd`:/mnt datascience/text2animeface:v0.1
然后安裝jupyter之后啟動jupyter
jupyter-notebook --allow-root
問題出現,外面無法訪問localhost:8888, telnet也不通,反復嘗試,不需要重新建立容器,直接使用以下命令啟動jupyter即可:
jupyter-notebook --allow-root --ip=0.0.0.0 --port=8888
ip地址綁定到0.0.0.0也就是任意ip地址吧,端口8888,
到此這篇關于Docker容器開jupyter不能訪問到的解決方法的文章就介紹到這了,更多相關Docker jupyter不能訪問 內容請搜索好吧啦網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持好吧啦網!
相關文章:
1. 解決Python中報錯TypeError: must be str, not bytes問題2. Python如何解決secure_filename對中文不支持問題3. Python使用oslo.vmware管理ESXI虛擬機的示例參考4. ASP基礎入門第二篇(ASP基礎知識)5. 不使用XMLHttpRequest對象實現Ajax效果的方法小結6. Python類成員繼承重寫的實現7. 使用python tkinter開發一個爬取B站直播彈幕工具的實現代碼8. Python 用NumPy創建二維數組的案例9. ThinkPHP6使用JWT+中間件實現Token驗證實例詳解10. python安裝sklearn模塊的方法詳解
