在192.168.1.244上搭建私有仓库
#docker pull registry
#docker run -d -p 5000:5000 -v /data/myregistry:/var/lib/registry --restart=always --name myregistry registry
#vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://frz7i079.mirror.aliyuncs.com"], #有逗号
"insecure-registries": ["192.168.1.244:5000"]
}
#systemctl restart docker
#docker pull nginx
#docker tag nginx 192.168.1.244:5000/nginx
#docker push 192.168.1.244:5000/nginx
在所有k8s节点上
#vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://frz7i079.mirror.aliyuncs.com"], #有逗号
"insecure-registries": ["192.168.1.244:5000"]
}
#systemctl restart docker
#docker pull 192.168.1.244:5000/nginx
原文地址:https://blog.51cto.com/dongdong/2424978
时间: 2024-10-08 10:54:45