搭建本地docker registry:
docker pull registry:2
mkdir /home/registry
docker run -d -p 5000:5000 --name registry -v /home/registry:/var/lib/registry registry:2
docker ps -a
netstat -ntpl | grep 5000
上传image到docker hub:
docker tag ubuntu:16.04 localhost:5000/ubuntu_16.04_v1
docker push localhost:5000/ubuntu_16.04_v1
远程上传image到docker hub:
docker tag image:ubuntu1604_v2 10.0.0.2:5000/ubuntu1604_v2
docker push 10.0.0.2:5000/ubuntu1604_v2
查看已上传的image:
docker search 10.0.0.2:5000
客户端下载image:
安装docker略
vi /etc/docker/daemon.json
{
"insecure-registries": [
"10.0.0.2:5000"
]
}
:wq
systemctl restart docker
docker pull 10.0.0.2:5000/ubuntu_16.04_v1
原文地址:https://blog.51cto.com/yangzhiming/2381145
时间: 2024-11-08 04:48:42