Docker private warehouse building registry

1. Download the image (if the mirror is not necessary to download ready)

[root@master_150 ~]# docker pull registry

2. Load Mirroring

[root@master_150 ~]# docker load -i registry-latest.tar

3. Run containers

[root@master_150 ~]# docker run -d -v /opt/registry:/var/lib/registry -p 5000:5000 --restart=always --privileged=true --name registry registry:latest

4. Modify the client configuration

docker private warehouse server, the default is based on https transmission, so we need to make the relevant settings in the client 192.168.1.160, do not use https transport

#新建配置文件
[root@master_150 ~]# vi /etc/docker/daemon.json

#将如下信息添加进去
{
    "registry-mirrors": ["https://registry.docker-cn.com"],
    "insecure-registries":["192.168.1.196:5000"]
}

#重启docker
[root@master_150 ~]# systemctl daemon-reload
[root@master_150 ~]# systemctl restart docker

5. The client image uploaded

#打tag
[root@master_150 ~]# docker tag redis:3.2 192.168.1.196:5000/redis:3.2

#上传镜像
[root@master_150 ~]# docker push 192.168.1.196:5000/redis:3.2

6. View Mirror

http://192.168.1.196:5000/v2/_catalog

7. Download Mirror

[root@master_150 ~]# docker pull 192.168.1.196:5000/redis:3.2

 

Published 28 original articles · won praise 36 · views 744

Guess you like

Origin blog.csdn.net/xieweikun_7/article/details/105334671