目录地址 /opt/docker/registry/
- 创建start_registry.sh
#!/bin/bash
docker run -d -p 5000:5000 -v /opt/docker/registry/data:/var/lib/registry --privileged=true --restart=always --name registry registry:2.6.2
- 文件加权限并执行
chmod +x start_registry.sh
./start_registry.sh
- 安装完成
配置dns域名
registry.msh.com IN A 192.168.70.11
配置docker仓库上传地址
vi /etc/docker/daemon.json
{
"registry-mirrors":[
"https://d8b3zdiw.mirror.aliyuncs.com"
],
"insecure-registries": ["registry.msh.com:5000"],
"dns":["192.168.70.11"]
}