运行Registry
代码语言:javascript复制[root@h104 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@h104 ~]# ls
anaconda-ks.cfg certs dockerfile
[root@h104 ~]# docker run -d -p 5000:5000 --restart=always --name registry -v `pwd`/data:/var/lib/registry -v `pwd`/certs:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/docker.crt -e REGISTRY_HTTP_TLS_KEY=/certs/docker.key registry:2
b578e321f33f6f2a0c34340b35239d1ce724c4523f3b2266bc01239658fc3f46
[root@h104 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b578e321f33f registry:2 "/bin/registry /etc/d" 6 seconds ago Up 5 seconds 0.0.0.0:5000->5000/tcp registry
[root@h104 ~]#
尝试push一个镜像
先tag一些镜像出来
其实就是将本地的镜像作一些别名(链接)
代码语言:javascript复制[root@h103 ~]# docker tag ubuntu 192.168.100.104:5000/ubuntu
[root@h103 ~]# docker tag ubuntu h104:5000/ubuntu
[root@h103 ~]# docker tag ubuntu docker-registry:5000/ubuntu
[root@h103 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
192.168.100.104:5000/ubuntu latest 8693db7e8a00 39 hours ago 187.9 MB
h104:5000/ubuntu latest 8693db7e8a00 39 hours ago 187.9 MB
localhost:5000/myfirstimage latest 8693db7e8a00 39 hours ago 187.9 MB
localhost:5000/ubuntu latest 8693db7e8a00 39 hours ago 187.9 MB
docker:5000/ubuntu latest 8693db7e8a00 39 hours ago 187.9 MB
h103:5000/ubuntu latest 8693db7e8a00 39 hours ago 187.9 MB
ubuntu latest 8693db7e8a00 39 hours ago 187.9 MB
docker-registry:5000/ubuntu latest 8693db7e8a00 39 hours ago 187.9 MB
jenkins latest fc39417bd5fb 12 days ago 708.1 MB
registry 2 683f9cd9cf88 2 weeks ago 224.5 MB
hello-world latest 0a6ba66e537a 3 months ago 960 B
[root@h103 ~]#