n 程序包(私有仓库)
https://hub.docker.com/_/registry?tab=tags
安装包:
yum info docker-regisry
yum install -y docker-registry (docker-distribution ->2.6.2 )
rpm -ql docker-distribution
/etc/docker-distribution/regisry/config.yml (配置文件)
/var/lib/registry (数据目录)
修改配置文件:
vim /etc/docker-distribution/regisry/config.ym
1、端口5000
2、rootdirectory:/var/lib/registry
systemctl start docker-distribution
ss -ntl
push 镜像:
docker images ls
docker tag myweb:v0.3-11 node02.magedu.com:5000/myweb:v0.3-11(顶层仓库
docker push node02.magedu.com:5000/myweb:v0.3-11
注意事项:registry https; server:http;
vim /etc/docker/daemon.json
{
"registry-mirrors":["https://4mii0w1b.mirror.aliyuncs.com"],
"insecure-registries":["node02.magedu.com:5000"]
}
systemctl restart docker (同样server and client 修改同样的配置)
docker push node02.magedu.com:5000/myweb:v0.3-11
服务端检查:
cd /var/lib/registry/;存在镜像层
node02:docker pull node02.magedu.com:5000/myweb:v0.3-11
vim /etc/docker/daemon.json
{
"registry-mirrors":["https://4mii0w1b.mirror.aliyuncs.com"],
"bip":"10.0.0.1/16",
"hosts":["tcp://0.0.0.0:2375","unix"://var/run/docker,sock"]
"insecure-registries":["node02.magedu.com:5000"]
}
docekr restart docker
node02:docker pull node02.magedu.com:5000/myweb:v0.3-11