docker 镜像制作

# wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.1-Linux-x86_64.sh
# bash Anaconda3-5.3.1-Linux-x86_64.sh

# 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 centos
docker exec -it test-centos1 /bin/bash
docker commit test-centos1 centos_sshd:7.0

conda install -c anaconda pymysql
from sqlalchemy import create_engine
engine=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-release

 linux 离线安装缺少包可强制安装
rpm -ivh  --nodeps  createrepo-0.9.9-28.el7.noarch.rpm #意思不考虑依赖

centos1
docker exec -it 93b7ef3dd8f8 /bin/bash 172.31.254.3
creditapp
docker exec -it 9999d669359a /bin/bash 172.31.254.7
xxl-job
docker exec -it 05f5424f45a4 /bin/bash 172.31.254.6
docker cp ./ROOT 05f5424f45a4:/usr/local/tomcat/webapps/ROOT
fastdfs
172.31.254.8
从服务器下载整个目录
scp -r root@172.96.190.155:/data/ROOT/ ./
docker cp /data/bak/ROOT 93b7ef3dd8f8:/data

 

转载于:https://www.cnblogs.com/adolfmc/p/11572696.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值