Ubuntu 版本
root@admin:/home/xd
Ubuntu 22.04.1 LTS \n \l
docker 版本
root@admin:/home/xd
Docker version 24.0.7, build 24.0.7-0ubuntu2~22.04.1
设置镜像源和docker配置vim /etc/docker/daemon.json
{
"insecure-registries":["ip:5000","docker-registry:5000"],
"registry-mirrors": [
"https://registry.docker-cn.com",
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://ccr.ccs.tencentyun.com"
]
}
重启docker进程
sudo systemctl daemon-reload
sudo systemctl restart docker
daemon方式 启动
docker pull registry
docker run -d -p 5000:5000 --restart=always --name private-images-registry registry:latest
验证
docker pull hello-wrold
docker tag hello-wrold:latest docker-registry:5000/v2/hello-world:v1
docker push docker-registry:5000/v2/hello-world:v1
curl docker-registry:5000/v2/_catalog
{"repositories":["demo/hello-world","v2/hello-world"]}