https://zhongneng.github.io/2019/03/16/docker-jupyter/
NV_GPU=0 nvidia-docker run -tid -v /home/code_directory jupyter:/home/code_directory -p 8877:8888 --name jupyter_serverce centos:7.5 /bin/bash
# 登錄容器
docker exec -it jupyter_serverce /bin/bash --login
# 安裝 jupyter
pip install jupyter notebook
# 配置jupyter notebook
jupyter notebook --generate-config
# 修改配置文件
vim ~/.jupyter/jupyter_notebook_config.py
# 第83行,允許遠(yuǎn)程訪問
c.NotebookApp.allow_remote_access = True
# 第85行,允許root啟動
c.NotebookApp.allow_root = True
# 第205行,監(jiān)聽任意的訪問IP地址
c.NotebookApp.ip = '*'
# 第263行,加載默認(rèn)的notebook文件夾,即容器啟動時掛載的主機(jī)代碼目錄
c.NotebookApp.notebook_dir = '/home/code_directory'
# 第354行,設(shè)置默認(rèn)token
c.NotebookApp.token = '1357'
# 啟動notebook
# 容器內(nèi)啟動
jupyter notebook &
# 主機(jī)內(nèi)啟動
docker exec jupyter_serverce jupyter notebook &
# Windows瀏覽器打開容器中的代碼目錄
# http://[主機(jī)IP]:[綁定容器的端口]/tree?token=[配置文件中所設(shè)置的c.NotebookApp.token值]
http://10.37.2.190:8877/tree?token=1357