或者WEB页也能看到:
很多时候,通过容器部署的应用以后要在其他机子上部署,如果直接将生成的镜像提交到docker hub上很不安全,也不方便使用,为此,Docker官方提供了docker-registry工具 ,可以用于构建私有的镜像仓库。
这里可以通过官方registry镜像来运行一个私有仓库:
registry
[root@newdocker2 /]# docker run -d -p 5000:5000 -v /myrepository:/var/lib/registry registry66e39749e6f291a5df613d27ecaab7341911d57b96ff423da52ad4290e57eeb0[root@newdocker2 /]#
默认情况下,仓库会被创建在容器的/var/lib/registry目录下,这里指定为/myrepository目录下存放本地仓库镜像文件。
/var/lib/registry
/myrepository
创建好私有仓库之后,就可以使用 docker tag 来标记一个镜像,然后推送它到仓库。例如私有仓库地址为127.0.0.1:5000,先在本机查看已有的镜像。
docker tag
[root@newdocker2 /]# docker image ls -aREPOSITORY TAG IMAGE ID CREATED SIZEnginx 1.23.3 3f8a00f137a0 3 weeks ago 142MBmoonrong/nginx 1.23.3 3f8a00f137a0 3 weeks ago 142MBredis latest 2e50d70ba706 8 months ago 117MBnginx <none> 55f4b40fe486 8 months ago 142MBbusybox latest 62aedd01bd85 8 months ago 1.24MBubuntu latest 27941809078c 8 months ago 77.8MBnginx <none> 0e901e68141f 9 months ago 142MBnginx latest 605c77e624dd 14 months ago 141MBregistry 2 b8604a3fe854 15 months ago 26.2MBregistry latest b8604a3fe854 15 months ago 26.2MBcentos 7.9.2009 eeb6ee3f44bd 17 months ago 204MBcentos latest 5d0da3dc9764 17 months ago 231MBcouchbase/centos7-systemd latest a7192f6d537a 4 years ago 411MB[root@newdocker2 /]#
服务热线
1391-024-6332