# wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
# bash# source ~/.bashrc
# conda -V# conda install jupyter notebook
# jupyter notebook# conda install ipython# ipython 进入python shell交互
# jupyter notebook --generate-config
Writing default config to: /root/.jupyter/jupyter_notebook_config.py# ipython //进入ipython交互模式
# In [1]: from notebook.auth import passwd# In [2]: passwd()Enter password:
Verify password: Out[2]: 'sha1:d93397e8cfba:d93d88814530642f44233b72110621aef924bdd7''sha1:97fb8b9cfed6:bd105748f3ce5f9ec1ff7eb21c43f00019c6ba6f'
修改默认配置文件
# vi ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip='*' # 设置所有ip皆可访问
c.NotebookApp.password = u'sha1:上面生成的哈希值' # c.NotebookApp.open_browser = False # 禁止自动打开浏览器c.NotebookApp.port = 8888 #指定一个端口更改存储文件地址## The directory to use for notebooks and kernels.2 c.NotebookApp.notebook_dir = 'E:\dev\Jupyter'启动jupyter
# jupyter notebook --allow-root
启动脚本 auto_service.sh
#!/bin/sh
/bin/serviceA start #启动服务/bin/bash #保留一个终端,防止容器自动退出 启动镜像按指定启动脚本docker run -d -t -v /etc/localtime:/etc/localtime -p 8889:8889 --name service_A imageX /home/auto_service.sh
登录和提交镜像
docker pull centos
docker run -it -d --name test-centos1 centosdocker exec -it test-centos1 /bin/bashdocker commit test-centos1 centos_sshd:7.0conda install -c anaconda pymysql
from sqlalchemy import create_engineengine=create_engine('mysql+pymysql://username:password.@HOST_IP:PORT/db_name?charset=utf8') conn = engine.connect() r = conn.execute('select sysdate()')查看 centos version cat /etc/redhat-releaselinux 离线安装缺少包可强制安装rpm -ivh --nodeps createrepo-0.9.9-28.el7.noarch.rpm #意思不考虑依赖
centos1
docker exec -it 93b7ef3dd8f8 /bin/bash 172.31.254.3 creditappdocker exec -it 9999d669359a /bin/bash 172.31.254.7xxl-jobdocker exec -it 05f5424f45a4 /bin/bash 172.31.254.6docker cp ./ROOT 05f5424f45a4:/usr/local/tomcat/webapps/ROOTfastdfs172.31.254.8从服务器下载整个目录scp -r root@172.96.190.155:/data/ROOT/ ./docker cp /data/bak/ROOT 93b7ef3dd8f8:/data