Docker实践
安装与卸载
安装
- 快速安装
curl -fsSL https://get.docker.com | sh -
卸载
- apt
apt-get remove --auto-remove docker
- yum
yum remove docker docker-common docker-selinux docker-engine
指定显卡(NVIDIA_VISIBLE_DEVICES)
#指定单张GPU卡
docker run --runtime=nvidia -d -e NVIDIA_VISIBLE_DEVICES=0 gouchicao/yolov5:train
#指定多张GPU卡,多个逗号隔开。
docker run --runtime=nvidia -d -e NVIDIA_VISIBLE_DEVICES=0,1 gouchicao/yolov5:train
#NVIDIA_VISIBLE_DEVICES默认值是all
docker run --runtime=nvidia -d gouchicao/yolov5:train
重启策略 方法 启动容器时通过参数指定 #如果容器停止总是重新启动。如果手动停止,则仅在Docker守护程序重启或手动重启容器本身时才重启。