首页 > 其他 > 详细

jupyter

时间:2019-08-30 15:11:24      阅读:54      评论:0      收藏:0      [点我收藏+]


(1)利用镜像ubuntu形成容器notebook_0【路径必须加】
docker run -itd --name notebook_0 -d -v /home/qiao/docker_qiao/jupyter:/home/qiao/jupyter ubuntu:18.04

(2)进入容器notebook_0:
docker exec -it notebook_0 /bin/bash

(3) 更新apt并装pip
apt update
apt install python3-pip vim locales fonts-wqy*

(4)装jupyter和常用包
pip3 install --upgrade --force-reinstall --no-cache-dir jupyter

(5)修改jupyter配置文件
5.1 jupyter notebook --generate-config
5.2 vim ~/.jupyter/jupyter_notebook_config.py

#c.NotebookApp.allow_root = True
c.NotebookApp.open_browser = False
c.NotebookApp.ip = ‘*‘
c.NotebookApp.port = 8221
c.NotebookApp.notebook_dir = ‘/home/qiao/jupyter‘
5.3 然后保存退出
5.4 检测是否安装成功:jupyter notebook --allow-root


(6)把容器notebook_0提交到镜像notebook_image
docker commit notebook_0 notebook_image

(7)开另一个终端,删除容器notebook_0
docker stop notebook_0
docker rm notebook_0

(8)#利用镜像notebook_image生成容器notebook_container


docker run -itd --name notebook_container -p 8222:8221 -v /home/qiao/docker_qiao/jupyter:/home/qiao/jupyter notebook_image

容器内运行:

               docker exec -it notebook_container /bin/bash 

               jupyter notebook --allow-root

容器外运行:docker exec notebook_container jupyter notebook --allow-root &

 

jupyter

原文:https://www.cnblogs.com/hapyygril/p/11434546.html

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