如何搭建私有Registry

2016-12-14 14:50:00
村里来的扫地僧
原创
7883
# docker run -d -p 5000:5000 -v /registry:/tmp/registry --name=docker_registry registry
[root@localhost ~]# docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry docker.io/registry
如何启动:
[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 ~]# 
发表评论
壹 乘 拾 =
评论通过审核后显示。