docker exec -it dfefa656bf29 /bin/bash
进入容器后,输入命令:jupyter notebook list
http://dfefa656bf29:8888/?token=03ec033-b:: /home/jovyan
记下token,设置密码 123123123
pip install jupyter
无法用pip3
apt-get update
apt-get install vim
jupyter-notebook --generate-config
#输入密码两次
jupyter-notebook password
# 复制下面的sha1码
cat /root/.jupyter/jupyter_notebook_config.json
vim /root/.jupyter/jupyter_notebook_config.py
# 在jupyter_notebook_config.py文件末填入下面配置:
# 允许通过任意绑定服务器的ip访问
c.NotebookApp.ip = '*'
# 用于访问的端口
c.NotebookApp.port = 8888
# 不自动打开浏览器
c.NotebookApp.open_browser = False
# 设置登录密码
c.NotebookApp.password = u'sha1:xxxxxxxxxxxxxxxx' # json中复制的sha1码
jupyter-notebook --ip=0.0.0.0 --allow-root
http://宿主机ip:8888
按Ctrl+P+Q退出容器但不关闭