目录
杭州阿里 mkmk 仓库
registry.cn-hangzhou.aliyuncs.com/mkmk/all
启动 本地 register server
默认部署的 是 http server, 但是 client 端 是 https 的 ,所以 在 client 端 需要 做一些 配置
docker run -d -p 5000:5000 --restart always --name registry registry
查看 所有仓库
http://192.168.99.100:5000/v2/_catalog
http://registry_ip:5000/v2/nginx/tags/list
http://192.168.111.200:5000/v2/tensorflow/tensorflow/tags/list
http://192.168.99.100:5000/v2/python/tags/list
修改 client 端 配置
## 添加 “ insecure-registries ”
cat > /etc/docker/daemon.json <<"EOF"
{
"registry-mirrors": ["https://wm12hkla.mirror.aliyuncs.com"],
"insecure-registries" : ["192.168.111.200:5000"]
} +
EOF
systemctl restart docker
测试 本地 register
# 测试 本地镜像 仓库
docker pull nginx
docker tag nginx 192.168.19.10:5000/nginx:new
docker push 192.168.19.10:5000/nginx:new
docker images
docker rmi 192.168.19.10:5000/nginx:new
docker images
docker pull 192.168.19.10:5000/nginx:new
私有 镜像仓库
# sever
docker run -d -p 5000:5000 --restart always --name registry1 registry
for i in 'registry:latest' 'owncloud:10'
do
j=${i//:/-}
remote_path="registry.cn-hangzhou.aliyuncs.com/mkmk/all:${j}"
docker tag ${i} ${remote_path}
docker push ${remote_path}
done
# client
cat > /etc/docker/daemon.json <<"EOF"
{
"registry-mirrors": ["https://wm12hkla.mirror.aliyuncs.com"],
"insecure-registries" : ["192.168.111.200:5000"]
}
EOF
systemctl restart docker
register_url='192.168.111.200:5000'
image_url='tensorflow/tensorflow:2.4.1-gpu'
docker pull $image_url
docker tag $image_url ${register_url}/$image_url
docker push ${register_url}/$image_url
批量推送镜像
# client
echo 'nameserver 114.114.114.114' > /etc/resolv.conf
register_url='192.168.111.200:5000'
for image_url in 'tensorflow/tensorflow:2.4.1-gpu' 'tensorflow/tensorflow:2.4.1-gpu-jupyter'
do
docker pull $image_url
docker tag $image_url ${register_url}/$image_url
docker push ${register_url}/$image_url
done
echo 'nameserver 114.114.114.114' > /etc/resolv.conf
register_url='192.168.111.200:5000'
for image_url in 'nvidia/cuda:11.1.1-devel' 'nvidia/cuda:11.1.1-runtime'
do
docker pull $image_url
docker tag $image_url ${register_url}/$image_url
docker push ${register_url}/$image_url
done
gpu
apt install nvidia-driver-450-server -y
docker run -it --gpus=all gpu-burn:cuda11.1
register_url='192.168.111.200:5000'
image_url='gpu-burn:cuda11.1'
docker tag $image_url ${register_url}/$image_url
docker push ${register_url}/$image_url
带数据 启动 register
docker run -d -p 5000:5000 --restart always --name registry1 -v /root/registry:/var/lib/registry registry
欢迎大家一起交流呀
qq群:3638803451
vx:wxid_sgdelhiwombj12