プライベートなレポジトリ自身も docker image で提供されている
$ docker run -d -p 5000:5000 -v /opt/registry:/tmp/registry:rw registry
core@localhost ~ $ docker images | grep ubuntu_monit_ssh
atsushi/ubuntu_monit_ssh latest c53db8fef482 4 weeks ago 409.9 MB
core@localhost ~ $ docker tag c53d localhost.localdomain:5000/ubuntu_monit_ssh
core@localhost ~ $ docker push localhost.localdomain:5000/ubuntu_monit_ssh
The push refers to a repository [localhost.localdomain:5000/ubuntu_monit_ssh] (len: 1)
Sending image list
Pushing repository localhost.localdomain:5000/ubuntu_monit_ssh (1 tags)
511136ea3c5a: Image successfully pushed
af82eb377801: Image successfully pushed
f33dbb8bc20e: Image successfully pushed
...
55f8f15091b9: Image successfully pushed
3791c88c3802: Image successfully pushed
c53db8fef482: Image successfully pushed
Pushing tag for rev [c53db8fef482] on {http://localhost.localdomain:5000/v1/repositories/ubuntu_monit_ssh/tags/latest}
core@localhost ~ $
core@localhost ~ $ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
registry latest a481306ce211 3 days ago 425 MB
atsushi/httpd latest 9e9c0baec26e 2 weeks ago 464.9 MB
atsushi/volume latest bd966fa0aa77 2 weeks ago 2.433 MB
atsushi/ubuntu_postgresql latest 3fe1ca3ec7d7 2 weeks ago 614.8 MB
atsushi/cent6_monit_ssh latest f7c8d5009f86 4 weeks ago 452.9 MB
localhost.localdomain:5000/ubuntu_monit_ssh latest c53db8fef482 4 weeks ago 409.9 MB
atsushi/ubuntu_monit_ssh latest c53db8fef482 4 weeks ago 409.9 MB
ubuntu 14.10 75204fdb260b 7 weeks ago 226.4 MB
cent6_monit latest 42c1c6908ea4 7 weeks ago 324.2 MB
cent6_apache latest 633e8b36e083 7 weeks ago 300.6 MB
centos centos6 b1bd49907d55 9 weeks ago 212.5 MB
centos latest b157b77b1a65 9 weeks ago 243.7 MB
busybox latest a9eb17255234 4 months ago 2.433 MB
docker run で、localhost.localdomain:5000/ubuntu_monit_ssh を指定すれば、プライベート・レポジトリから実行することができる
core@localhost ~ $ curl -X GET http://192.168.38.101:5000/v1/search?q=
{"num_results": 1, "query": "", "results": [{"description": "", "name": "library/ubuntu_monit_ssh"}]}
core@localhost ~ $ ip -f inet addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: enp0s17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
inet 192.168.38.102/24 brd 192.168.38.255 scope global dynamic enp0s17
valid_lft 1091sec preferred_lft 1091sec
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
inet 172.17.42.1/16 scope global docker0
valid_lft forever preferred_lft forever
core@localhost ~ $ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
core@localhost ~ $ docker pull 192.168.38.101:5000/ubuntu_monit_ssh
Pulling repository 192.168.38.101:5000/ubuntu_monit_ssh
c53db8fef482: Pulling dependent layers
511136ea3c5a: Download complete
af82eb377801: Download complete
...
55f8f15091b9: Download complete
3791c88c3802: Download complete
core@localhost ~ $ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
192.168.38.101:5000/ubuntu_monit_ssh latest c53db8fef482 4 weeks ago 409.9 MB