registry私有仓库搭建

炒沙作縻终不饱,缕冰文章费工巧。这篇文章主要讲述registry私有仓库搭建相关的知识,希望能为你提供帮助。
【registry私有仓库搭建】

1.关闭防火墙

[root@registry ~]# systemctl stop firewalld
[root@registry ~]# systemctl disable firewalld

2.关闭selinux
[root@registry ~]# vi /etc/selinux/config

将 SELINUX=enforcing 修改为 SELINUX=disabled
3.安装docker
二、部署registry 1.下载registry镜像
[root@registry ~]# docker pull registry

2.配置registry信息
[root@master1 v2]# vi /etc/docker/daemon.json


"insecure-registries":["192.168.5.128:5000"]

重启docker服务
[root@master1 ~]# systemctl restart docker

3.启动registry容器
[root@registry ~]# docker run ‐d ‐p 5000:5000 ‐v /home/registry:/var/lib/registry ‐‐
restart=always ‐‐privileged=true ‐‐name=registry registry:latest

查看registry容器
[root@master1 ~]# docker ps
fb611b773430registry:latest"/entrypoint.sh /etc…"About an hour agoUp About an hour0.0.0.0:5000-> 5000/tcp, :::5000-> 5000/tcpregistry

三、测试验证 1.本地镜像push到私有仓库
[root@master1 ~]# docker images
REPOSITORYTAGIMAGE IDCREATEDSIZE
nginxlatestd1a364dc548d3 weeks ago133MB

2.修改镜像tag
[root@master1 ~]# docker tag nginx:latest 192.168.5.128:5000/nginx:test

3.把修改了tag镜像上传到私有仓库
[root@master1 ~]# docker push 192.168.5.128:5000/nginx:test
The push refers to repository [192.168.5.128:5000/nginx]
075508cf8f04: Layer already exists
5c865c78bc96: Layer already exists
134e19b2fac5: Layer already exists
83634f76e732: Layer already exists
766fe2c3fc08: Layer already exists
02c055ef67f5: Layer already exists
test: digest: sha256:61191087790c31e43eb37caa10de1135b002f10c09fdda7fa8a5989db74033aa size: 1570

4.查询仓库镜像
[root@master1 ~]# curl http://192.168.5.128:5000/v2/_catalog
"repositories":["nginx"]

5.查询仓库里nginx镜像的tag
[root@master1 ~]# curl http://192.168.5.128:5000/v2/nginx/tags/list
"name":"nginx","tags":["test"]




    推荐阅读