1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 如何启动: [root@localhost ~]# docker run -d -p 5000:5000 registry 进入registry: [root@localhost ~]# docker exec -it a19b39b5cd25 bash 访问仓库: [root@localhost ~]# curl 127.0.0.1:5000 打标签centos--centos-server [root@localhost ~]# docker tag centos 127.0.0.1:5000/centos-server 上传至registry [root@localhost ~]# docker push 127.0.0.1:5000/centos-server The push refers to a repository [127.0.0.1:5000/centos-server] (len: 1) Sending image list Pushing repository 127.0.0.1:5000/centos-server (1 tags) 5a7df8dd4d20: Image successfully pushed Pushing tag for rev [5a7df8dd4d20] on {http://127.0.0.1:5000/v1/repositories/centos-server/tags/latest} [root@localhost ~]# 查看仓库中的镜像: [root@localhost ~]# curl http://127.0.0.1:5000/v1/search {"num_results": 1, "query": "", "results": [{"description": "", "name": "library/centos-server"}]} [root@localhost ~]# |