Jupyter环境的搭建以及相应的Dockerfile

pip install jupyter  
jupyter notebook --generate-config
#生成密码,用于远程登陆
python -c "from notebook.auth import passwd; print(\"c.NotebookApp.password = u'\" +  passwd('123456') + \"'\")" >> /root/.jupyter/jupyter_notebook_config.py
#自定义端口
echo c.NotebookApp.port = 2678  >> /root/.jupyter/jupyter_notebook_config.py
jupyter notebook --ip=0.0.0.0 --no-browser --allow-root

Dockerfile()

...  配置好python环境
RUN pip install jupyter  
RUN jupyter notebook --generate-config
#生成密码,用于远程登陆
RUN python -c "from notebook.auth import passwd; print(\"c.NotebookApp.password = u'\" +  passwd('123456') + \"'\")" >> /root/.jupyter/jupyter_notebook_config.py
#自定义端口
RUN echo c.NotebookApp.port = 2678  >> /root/.jupyter/jupyter_notebook_config.py
CMD ["jupyter notebook" ,  "--ip=0.0.0.0"  , "--no-browser" ,  "--allow-root"]

你可能感兴趣的:(算法实践,人工智能,杂谈)