$ cp config_sample.yml config.yml
$ vi config.yml
...
# This is the default configuration when no flavor is specified
dev:
storage: local
storage_path: /home/vpsee/registry
loglevel: debug
...
打开浏览器,访问 IP 地址就可以看到 docker-registry 私有仓库在运行了:
Docker-Registry
查看一下现有系统上已经有了哪些镜像:
$ sudo docker images
REPOSITORY TAG ID CREATED SIZE
vpsee/<strong><a href="http://www.21ops.com/linux/desktop" title="ubuntu" target="_blank">ubuntu</a></strong> latest 936a54e8a345 2 weeks ago 12.29 kB (virtual 327.8 MB)
ubuntu latest 8dbd9e392a96 6 months ago 131.5 MB (virtual 131.5 MB)
ubuntu precise 8dbd9e392a96 6 months ago 131.5 MB (virtual 131.5 MB)
ubuntu quantal b750fe79269d 7 months ago 24.65 kB (virtual 180.1 MB)
我们打算把 vpsee/ubuntu 这个镜像(ID 是 936a54e8a345)上传(push)到我们刚创建的私有仓库里(这个私有仓库的 IP 地址是 192.168.2.45),会看到提示 Username/Password,初次 push 的话,可以自己设置用户名和密码:
$ sudo docker tag 936a54e8a345 192.168.2.45/vpsee
$ sudo docker push 192.168.2.45/vpsee
Username: vpsee
Password:
Email: docker@vpsee.com
Account created. Please use the confirmation link we sent to your e-mail to activate it.
The push refers to a repository [192.168.2.45/vpsee] (len: 1)
Processing checksums
Sending image list
Pushing repository 192.168.2.45/vpsee (1 tags)
Pushing 8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c
Buffering to disk 58266504/? (n/a)
Pushing 58.27 MB/58.27 MB (100%)
完成 push 后,我们的私有仓库就有了第一个镜像了:
$ sudo docker images
REPOSITORY TAG ID CREATED SIZE
vpsee/ubuntu latest 936a54e8a345 2 weeks ago 12.29 kB (virtual 327.8 MB)
ubuntu latest 8dbd9e392a96 6 months ago 131.5 MB (virtual 131.5 MB)
ubuntu precise 8dbd9e392a96 6 months ago 131.5 MB (virtual 131.5 MB)
ubuntu quantal b750fe79269d 7 months ago 24.65 kB (virtual 180.1 MB)
192.168.2.45/vpsee latest 936a54e8a345 2 weeks ago 12.29 kB (virtual 327.8 MB)