服务器端配置
第一步,修改/etc/docker/daemon.json文件
替换为:
{
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
},
"exec-opts": ["native.cgroupdriver=systemd"]
"log-driver": "json-file",
"log-opts": {
"max-size": "310m",
"max-file":"1",
"labels": "somelabel",
"env": "os,customer"
},
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn", "https://hub-
mirror.c.163.com", "https://9iudsi8t.mirror.aliyuncs.com"],
"insecure-registries":["192.168.1.64:5000"]
}
第二步,启动私有仓库服务
命令如下:
sudo docker run -d --restart=always -p 5000:5000 --privileged=true -v /home/data/history:/var/lib/registry registry:latest
第三步:重启服务
systemctl daemon-reload
systemctl restart docker.service
systemctl enable docker.service
客户端配置
第一步:配置/etc/docker/daemon.json
添加如下:
"insecure-registries":["192.168.1.65:5000", "192.168.1.64:5000"]
第二步:重启服务
systemctl daemon-reload
systemctl restart docker.service
systemctl enable docker.service
私有仓库上传和下载
docker tag 951ad6faa16f 192.168.1.64:5000/aa/worker:gtx3080
docker push 192.168.1.64:5000/aa/worker:gtx3080
docker pull 192.168.1.64:5000/aa/worker:gtx3080
|