1,卸载软件:nvidia-docker2
sudo apt-get remove nvidia-docker2
dpkg -l | grep docker#先查看
sudo apt remove --purge docker.io
# 先启动docker
systemctl start docker
# 然后拉取ngnix的镜像
docker pull ngnix
2,保存镜像到本地
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest feb5d9fea6a5 9 months ago 13.3kB
nvidia/cuda 10.1-base bfa75f8b799e 12 months ago 105MB
sudo docker save -o hello-world.tar hello-world:latest
3,加载本地镜像
sudo docker load -i hello-world.tar
#修改名称和tag
docker tag 【镜像ID】【镜像名称】:【tag版本信息】
docker tag 8ef375298394 mysql:v5.7
4,删除镜像
5,查看未启动容器
sudo docker ps -a
6,查看容器
sudo docker ps
设置容器自动启动参考
#停止容器
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8b4e78a4f1ab registry.baidubce.com/paddlepaddle/serving:0.9.0-cuda10.1-cudnn7-devel "/bin/bash" 9 minutes ago Exited (0) 17 seconds ago kind_wiles
0bf9637d4edf registry.baidubce.com/paddlepaddle/serving:0.9.0-cuda10.1-cudnn7-devel "/bin/bash" 3 hours ago Up 3 hours 22/tcp serene_murdock
crnn@crnn-System-Product-Name:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0bf9637d4edf registry.baidubce.com/paddlepaddle/serving:0.9.0-cuda10.1-cudnn7-devel "/bin/bash" 3 hours ago Up 3 hours 22/tcp serene_murdock
crnn@crnn-System-Product-Name:~$ sudo docker stop kind_wiles
kind_wiles
crnn@crnn-System-Product-Name:~$ sudo docker stop serene_murdock
7,启动未启动的容器
sudo docker start Container 0ffe6114715e
8,docker操作
sudo service docker start
sudo service docker stop
sudo service docker restart
sudo docker container prune#删除所有容器
sudo docker rmi ce5aa74a48f1#删除镜像
9,文件操作
sudo mkdir new-path#创建new-path
常用的几个rm命令:
#删除一个空目录
rm -d 目录名
#删除一个空目录
rm -dir 目录名
#删除一个非空目录
rm -r 目录名
#删除文件
rm 文件名
10,只读属性去除,先进入到当前文件目录,在执行,sudo chmod 777 [文件名]
crnn@crnn-System-Product-Name:~/PycharmProjects/pythonProject$ sudo chmod 777 web_service.py
crnn@crnn-System-Product-Name:~/PycharmProjects/pythonProject$ sudo chmod 777 pipeline_http_client.py
11,编写shell脚本:
参考
#!/bin/bash
cd PaddleOCR/deploy/pdserving/
nohup python3.7 web_service.py &>log.txt &
/bin/bash