docker常用指令,问题整理

8 篇文章 0 订阅
1 篇文章 0 订阅
1docker search centos7 
2docker pull ansible/centos7-ansible获取镜像,以此为基础
3docker run -itd -p 5000:5000 --restart=always --name  centos7_tibet ansible/centos7-ansible  /bin/bash//把镜像启动为容器,-i表示让容器的标准输入打开,-t表示分配一个伪终端,-d表示后台启动,要把-i -t -d 放到镜像名字前面
4docker cp /opt/image_class_install/ centos7_tibet:/opt///把相关安装包copy到相关文件夹下,不支持*的通配符
5docker exec -it tf_tibet_detect /bin/bash进入容器进行交互
6cd /opt/image_class_install/install/ 
7yum localinstall -y --nogpgcheck libICE-1.0.9-9.el7.x86_64.rpm libSM-1.2.2-2.el7.x86_64.rpm libX11-1.6.7-2.el7.x86_64.rpm libX11-common-1.6.7-2.el7.noarch.rpm libXau-1.0.8-2.1.el7.x86_64.rpm libxcb-1.13-1.el7.x86_64.rpm libXrender-0.9.10-1.el7.x86_64.rpm libXext-1.3.3-3.el7.x86_64.rpm 
8bash Anaconda3-2019.10-Linux-x86_64.sh 
9source ~/.bashrc激活python3环境
10yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/CentOS_7/
rpm --import https://build.opensuse.org/projects/home:Alexander_Pozdnyakov/public_key
yum update
yum install tesseract
pip install tesseract
pip install pytesseract
 
11mv /opt/image_class_install/install/ocr/* /usr/share/tesseract/4/将一些识别字符模块放入
12tesseract --list-langs
//如果显示 如下则为正常
(base) [root@3d1dd0364615 ansible]# tesseract --list-langs
List of available languages (9):
Tibetan
chi_sim
chi_sim_best
chi_sim_vert
chi_tra
chi_tra_vert
chr
eng
osd

 
 
13/opt/image_class_install/install/whls 
14python setup_for_cpu.py安装识别的python模块
15编辑/opt/image_class_install/src/linux_run_server.sh 看里面python运行路径是否正确
nohup /root/anaconda3/bin/python /opt/image_class_install/src/start_server.py > start_server_log.txt &
 
16chmod 777 /opt/image_class_install/src/linux_run_server.sh 
18docker commit centos7_tibet tibet_centos7:v1.0将容器存为镜像
19docker save -o tibet_centos7.tar tibet_centos7:v1.0将镜像存为文件
   
   
   
   
1docker load --input tibet_centos7.tar导入镜像文件
2sudo docker run -itd -p 5000:5000 --restart=always --name  tibet_detect_1.0 tibet_centos7:v1.0  /bin/bash /opt/image_class_install/src/linux_run_server.sh将镜像装入容器 开启5000端口
3sudo docker exec -it tibet_detect_1.0 /bin/bash 
4docker logs -f tibet_detect_1.0查看日志
   
   
1.0版本1,获取镜像
sudo wget http://10.10.10.251/E%3A/working/python/YS_Img_Classification/image_class_install/centos_tibet_detection/docker_img/tibet_centos7.tar
2,将本地包导入到镜像中:
sudo  docker load --input tibet_centos7.tar
3,启动镜像:
sudo docker run -itd -p 5000:5000 --restart=always --name  tibet_detect_1.0 tibet_centos7:v1.0  /bin/bash /opt/image_class_install/src/linux_run_server.sh
 
停止并删除之前的docker stop  tibet_detect_1.0
docker rm tibet_detect_1.0
docker rmi tibet_centos7:v1.0
 
1.1版本
1,获取镜像
sudo wget http://10.10.10.251/E%3A/working/python/YS_Img_Classification/image_class_install/linux/centos_tibet_detection/docker_img/tibet_centos7.tar
2,将本地包导入到镜像中:
sudo  docker load --input tibet_centos7.tar
3,启动镜像:
sudo docker run -itd -p 5000:5000 --restart=always --name  tibet_detect_1.1 tibet_centos7:v1.1 /bin/bash /opt/image_class_install/src/linux_run_server.sh
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值