#!/bin/bash
# Docker 镜像加速配置 - DaoCloud
# 由 镜像加速站 自动生成

echo "正在配置 Docker 镜像加速..."

# 创建或修改 daemon.json
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json > /dev/null << 'EOF'
{
  "registry-mirrors": ["https://docker.m.daocloud.io"]
}
EOF

echo "✓ 镜像加速配置已更新"

# 重启 Docker 服务
echo "正在重启 Docker 服务..."
sudo systemctl daemon-reload
sudo systemctl restart docker

# 验证配置
echo "\n当前镜像加速配置："
docker info | grep "Registry Mirrors" -A 1

echo "\n✅ Docker 镜像加速已成功配置为 DaoCloud"