docker私有仓库建立与镜像推送

简单记录:

1.拉原始镜像

docker pull regsitry

docker pull centos

2.启动registry仓库

docker run -t -i -d -p 5000:5000 -v /root/my_registry:/tmp/registry registry [你懂的]

3.给进行打标签

docker tag 9dbcac75201e docker10.sklinux.com:5000/centos:7  [tag为仓库地址+端口+名称+版本]

4.推送镜像至私有仓库

docker push docker10.sklinux.com:5000/centos:7[你懂的]

 

root@docker10:~/my_registry# docker tag 9dbcac75201e docker10.sklinux.com:5000/centos:7
root@docker10:~/my_registry# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
centos 7 9dbcac75201e 3 days ago 215.6 MB
centos centos7 9dbcac75201e 3 days ago 215.6 MB
centos latest 9dbcac75201e 3 days ago 215.6 MB
docker10.sklinux.com centos7 9dbcac75201e 3 days ago 215.6 MB
docker10.sklinux.com:5000/centos 7 9dbcac75201e 3 days ago 215.6 MB
centos 7.1.1503 b58de3b24eb7 9 days ago 212.1 MB
centos centos7.1.1503 b58de3b24eb7 9 days ago 212.1 MB
registry latest 59b1f7d49dc8 9 days ago 413.6 MB
centos 5.11 2e4a66ce2189 5 weeks ago 284.2 MB
centos centos5.11 2e4a66ce2189 5 weeks ago 284.2 MB
centos 6.6 0bc55ae673f7 5 weeks ago 202.6 MB
centos centos6.6 0bc55ae673f7 5 weeks ago 202.6 MB
centos 7.0.1406 99d42dc65aa6 5 weeks ago 210.2 MB
centos centos7.0.1406 99d42dc65aa6 5 weeks ago 210.2 MB
centos 5 861c710fef70 5 weeks ago 284.1 MB
centos centos5 861c710fef70 5 weeks ago 284.1 MB
centos 6 f6808a3e4d9e 5 weeks ago 202.6 MB
centos centos6 f6808a3e4d9e 5 weeks ago 202.6 MB
root@docker10:~/my_registry# docker push docker10.sklinux.com:5000/centos:7
The push refers to a repository [docker10.sklinux.com:5000/centos] (len: 1)
Sending image list
Pushing repository docker10.sklinux.com:5000/centos (1 tags)
511136ea3c5a: Image successfully pushed
b6718650e87e: Image successfully pushed
493bab5fff45: Image successfully pushed
9dbcac75201e: Image successfully pushed
Pushing tag for rev [9dbcac75201e] on {http://docker10.sklinux.com:5000/v1/repositories/centos/tags/7}
root@docker10:~/my_registry# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
centos 7 9dbcac75201e 3 days ago 215.6 MB
centos centos7 9dbcac75201e 3 days ago 215.6 MB
centos latest 9dbcac75201e 3 days ago 215.6 MB
docker10.sklinux.com centos7 9dbcac75201e 3 days ago 215.6 MB
docker10.sklinux.com:5000/centos 7 9dbcac75201e 3 days ago 215.6 MB
centos 7.1.1503 b58de3b24eb7 9 days ago 212.1 MB
centos centos7.1.1503 b58de3b24eb7 9 days ago 212.1 MB
registry latest 59b1f7d49dc8 9 days ago 413.6 MB
centos 5.11 2e4a66ce2189 5 weeks ago 284.2 MB
centos centos5.11 2e4a66ce2189 5 weeks ago 284.2 MB
centos 6.6 0bc55ae673f7 5 weeks ago 202.6 MB
centos centos6.6 0bc55ae673f7 5 weeks ago 202.6 MB
centos 7.0.1406 99d42dc65aa6 5 weeks ago 210.2 MB
centos centos7.0.1406 99d42dc65aa6 5 weeks ago 210.2 MB
centos 5 861c710fef70 5 weeks ago 284.1 MB
centos centos5 861c710fef70 5 weeks ago 284.1 MB
centos 6 f6808a3e4d9e 5 weeks ago 202.6 MB
centos centos6 f6808a3e4d9e 5 weeks ago 202.6 MB