安装docker Jupyterlab
<!--创建ubuntu镜像,设置端口,设置映射,外加重命名-->
docker run -i -t -d --name ubuntuJupyter02 -p 8005:8005 --privileged=true -v /opt/weiqi/Jupyter:/opt/weiqi/Jupyter ubuntu
<!--进入镜像中-->
docker exec -it ubuntuJupyter02 /bin/bash
<!--下载 vi-->
chmod 777 /tmp
apt-get update --allow-unauthenticated
apt-get update
apt-get install vim
<!--下载 python3 环境-->
apt-get update && apt-get install python3 -y && apt-get install python3-pip -y
<!--下载 jupyterlab,下载 ipython,下载jupyterlab-language-pack-zh-CN【中文包】-->
python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyterlab ipython jupyterlab-language-pack-zh-CN
<!--进入 ipython 中,设置密码,并复制密码备用-->
ipython
from notebook.auth import passwd
passwd()
123456
123456
exit
<!--生成 jupyterlab 配置文件:-->
jupyter lab --generate-config
<!--修改配置文件:-->
vi /root/.jupyter/jupyter_notebook_config.py
<!--更改内容如下:-->
#将ip设置为*,意味允许任何IP访问
c.NotebookApp.ip = '*'
#这里的密码就是上边我们生成的那一串
c.NotebookApp.password = 'sha1:f704b702aea2:01e2bd991f9c7208ba177b46f4d10b6907810927'
#服务器上并没有浏览器可以供Jupyter打开
c.NotebookApp.open_browser = False
#监听端口设置为8888或其他自己喜欢的端口
c.NotebookApp.port = 8005
#允许远程访问
c.NotebookApp.allow_remote_access = True
c.NotebookApp.notebook_dir = '/opt/weiqi/Jupyter'
<!--jupyter lab启动jupyter服务即可:-->
jupyter lab --allow-root
<!--无命令行模式-->
nohup jupyter lab --allow-root &
<!--下载 python 所需要的包-->
python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple crypto pycryptodome requests
<!--进入链接,输入链接密码,进行使用-->
http://192.168.1.210:8005
123456
效果图: