在docker注册表中找到centos官方资源,下载资源包,部署容器
操作比较简单,此处不过多说明
安装完系统后
1、安装wget工具
yun install wget2、安装gcc工具
yun install gcc3、升级yum
yum install yum需要注意,安装Python前,要先安装zlib,否则make install时会报错
1、yum install zlib
2、yum install zlib*
配置源:
yum install \ https://repo.ius.io/ius-release-el6.rpm \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo安装Python3
yum install python36u -y创建软连接
ln -s /usr/bin/python3.6 /bin/python32.3 安装pip3
yum install python36u-pip -ypip3软连接
ln -s /usr/bin/pip3.6 /bin/pip3升级pip3
pip3 install --upgrade pip
1、使用pip3安装Jupyter
pip3 install jupyter2、配置Jupyter
jupyter notebook --generate-config3、生成密码
from notebook.auth import passwd passwd()4、修改配置文件
#如未安装vim,可以直接使用vi。如需安装vim,直接输入yum install vim即可 vim /root/.jupyter/jupyter_notebook_config.py c.NotebookApp.password = 'sha1:xxxxxxxxxxxxxx' c.NotebookApp.port = 8888 c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.notebook_dir = '/jupyter/Notes' # 此处可自定义其中,password部分可以使用Python生成
进入Python,输入ipython
ipython .... IN [1]: from notebook.auth import passwd IN [2]: passwd() # 按提示输入两次密码 生成 sha1:xxxxx.xxxxxxxx把生成的密码放入上面的Password中
1、创建自定义的启动jupyter notebook的sh命令文件
vim /jupyter/start-jupyter.sh # 在打开的文件中,输入 cd /jupyter/Logs nohup jupyter notebook --allow-root & # 先进入指定要写日志的文件夹 # 启动Jupyter Notebook,并指定把日志写在当前目录下2、设置为启动项
# 打开或创建启动项管理文件 vim /etc/rc.d/rc.local # 在文件里加入要启动的刚刚创建的sh文件 /jupyter/start-jupyter.sh # 按下:w保存 # 按下:q退出 #把刚刚的rc.local文件和sh文件设置为可执行程序 chmod +x /etc/rc.d/rc.local chmod +x /jupyter/start-jupyter.sh
重启系统,完工