init/init-docker.sh
2025-01-04 15:52:23 +08:00

24 lines
504 B
Bash

#!/bin/bash
command_exists() {
command -v "$@" > /dev/null 2>&1
}
if command_exists docker; then
echo "docker 已安装.... 跳过"
( set -x; sleep 5 )
else
curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/docker-install.sh | sh
fi
cat > /etc/docker/daemon.json <<EOF
{
"registry-mirrors": [
"https://docker.martin98.com",
"https://registry-docker.martin98.com",
"https://registry-dockerhub.hk.martin98.com"
]
}
EOF
sudo systemctl restart docker