Docker搭建Jupyter服务

1
docker run -itd --name=jupyter -v /userdatas/Sandisk/Jupyter:/home/jovyan -p 10000:8888 --restart=unless-stopped jupyter/minimal-notebook:latest

映射目录到宿主机:/userdatas/Sandisk/Jupyter 此容器的更多运行参数:https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#docker-options

1
chown 1000:1000 /userdatas/Sandisk/Jupyter -R

在线生成https://tool.oschina.net/encrypt?type=2

修改之前先进入容器里执行jupyter notebook --generate-config命令,就会在宿主机/userdatas/Sandisk/Jupyter/.jupyter目录下生成jupyter_notebook_config.py文件

或者 直接touch生成该文件,文件内容如下:

1
2
c.NotebookApp.password = u'sha1:第三步生成的密码sha1值'
c.NotebookApp.password_required = True
1
chown 1000:1000 jupyter_notebook_config.py