From db7bccdc6867c3963a4a71c9357cb3bdc94996c5 Mon Sep 17 00:00:00 2001 From: Zhang Peng Date: Thu, 2 Apr 2020 10:38:28 +0800 Subject: [PATCH] update docker install script --- codes/linux/soft/docker-install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/codes/linux/soft/docker-install.sh b/codes/linux/soft/docker-install.sh index fd142bc..8907e74 100644 --- a/codes/linux/soft/docker-install.sh +++ b/codes/linux/soft/docker-install.sh @@ -45,3 +45,18 @@ sudo yum install docker-ce docker-ce-cli containerd.io sudo systemctl start docker docker version printf "${GREEN}<<<<<<<< install docker end.${RESET}\n" + +printf "${GREEN}>>>>>>>> replace chinese docker mirror registry${RESET}\n" +if [[ -f "/etc/docker/daemon.json" ]]; then + mv /etc/docker/daemon.json /etc/docker/daemon.json.bak +else + mkdir -p /etc/docker +fi +touch /etc/docker/daemon.json +cat >> /etc/docker/daemon.json << EOF +{ + "registry-mirrors": ["https://hub-mirror.c.163.com"] +} +EOF +systemctl daemon-reload +systemctl restart docker