2014-09-29 60 views
3

我在Windows Pro 8.1中使用Surface Pro 3。我試圖從docker訪問IPython筆記本。我使用的命令是在windows中從boot2docker打開Ipython筆記本

ipython notebook --no-browser --port 8888 "--ip=*" 

筆記本電腦正在運行,但它不是在我的瀏覽器中打開,這是我所得到的,當我運行它

[I 23:16:44.921 NotebookApp]B Using existing profile dir: u'/home/itam/.ipython/profile_default' 
[I 23:16:44.990 NotebookApp]B Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js 
[C 23:16:45.012 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended. 
[C 23:16:45.012 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using authentication. This is highly insecure and not recommended. 
[I 23:16:45.018 NotebookApp]B Serving notebooks from local directory: /home/itam/mate-computacional/itam-mate-computacional 
[I 23:16:45.018 NotebookApp]B 0 active kernels 
[I 23:16:45.018 NotebookApp]B The IPython Notebook is running at: http://[all ip addresses on your system]:8888/ 
[I 23:16:45.019 NotebookApp]B Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). 

我的虛擬機的IP地址是192.168.59.103,但是https://192.168.59.103:8888/未打開筆記本。

+0

我認爲你需要明確地告訴它從你的VM公開的8888端口爲8888本地系統上。請參閱http://docs.docker.com/installation/windows/#container-port-redirection – 2014-10-03 16:58:26

回答

1

開始boot2docker,創造新的泊塢窗容器ipython1

docker run -it -ip 8888:8888 -v //c/Users/USERNAME://usr/data --name ipython1 <image_name> 

IMAGE_NAME - 您的碼頭工人形象的名字

-vfolder_in_your_win_machine:folder_in_docker_container

-ipport_in_win:port_in_docker_container

開始搬運工容器ipython1並啓動IPython的在泊塢窗容器筆記本:

docker start ipython1 
docker exec -it ipython1 ipython notebook --ip=0.0.0.0 --no-browser 

下一頁轉到Windows瀏覽器,輸入網址:docker_ip:8888。 要知道搬運工IP執行:

boot2docker ip