首页 > 其他 > 详细

docker中安装jupyter,远程访问

时间:2020-01-08 03:12:27      阅读:297      评论:0      收藏:0      [点我收藏+]

进入docker交互式环境:docker exec -it ***** bash

安装jupyter:

  • 安装python dev包 :  apt-get install python-dev
  • 安装jupyter :  pip install jupyter [若pip没安装好,需要安装sudo apt install python3-pip]

配置文件:

  • 生成jupyter配置文件:jupyter notebook --generate-config
  • 使用ipython生成密码 

In [1]: from notebook.auth import passwd

In [2]: passwd()

Enter password:

Verify password:

Out[2]: ‘sha1:******‘

  • 到配置文件/root/.jupyter/jupyter_notebook_config.py中修改以下参数

c.NotebookApp.ip=‘*‘                          #绑定所有地址,即所有IP 地址都可以访问
c.NotebookApp.password = u‘sha1:******
c.NotebookApp.open_browser = False            #启动后是否在浏览器中自动打开
c.NotebookApp.port =8100                      #指定一个访问端口8100,默认8888

c.NotebookApp.allow_remote = True     #将远程访问设置成True

 

启动:

jupyter notebook --allow-root

 

远程访问:

  • 查看docker IP,需安装  apt install net-tools ,然后输入命令ifconfig -a。

找到inet后的IP地址即为docker地址。如:inet  153.16.0.1

  • 远程访问:http://153.16.0.1:8100即可。8100为配置文件时修改的启动端口,若有密码,即token=  后面输入密码。/

 

docker中安装jupyter,远程访问

原文:https://www.cnblogs.com/Lee-yl/p/12163947.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!