UBUNTU:
apt-get update
apt install docker.io
拉取Registry:
docker run -d -p 5000:5000 --name registry --restart=always -v /opt/data/registry:/tmp/registry registry
查看端口监听:
ps -ef|grep 5000
查看 registry 等镜像:
docker images
给需要上传的镜像打TAG:
docker tag {imageID} IP:5000/imagename
e.g.
docker tag 8090qbcdbalala 192.168.0.55:5000/nonnikms
上传镜像到仓库:
docker push 192.168.0.55:5000/nonnikms
从私有仓库拉取镜像:
docker pull 192.168.0.55:5000/nonnikms
查看 Registry 中所有镜像信息:
curl http://192.168.1.160:5000/v2/_catalog
查看 Registry 中标签列表:
curl http://192.168.1.160:5000/v2/smokeping/tags/list
注:
若 docker push 提示:http: server gave HTTP response to HTTPS client 错误的解决方法:
在客户端 /etc/docker 下添加 daemon.json
{
"insecure-registries": ["192.168.0.55:5000"]
}
重启docker:
systemctl restart docker