fix: 修复初次安装时docker服务没有启动的问题 #13208

This commit is contained in:
xuwei-fit2cloud 2024-11-08 09:22:28 +08:00
parent 2f5805f63b
commit c14ce2fe0e

View File

@ -201,14 +201,16 @@ function install_docker() {
EOF
fi
log_content "启动 docker"
systemctl enable docker >/dev/null 2>&1; systemctl daemon-reload; systemctl start docker 2>&1 | tee -a ${CURRENT_DIR}/install.log
docker version >/dev/null 2>&1
if [ $? -ne 0 ]; then
log_content "docker 安装失败"
exit 1
else
log_content "docker 安装成功"
log_content "启动 docker"
systemctl enable docker >/dev/null 2>&1; systemctl daemon-reload; systemctl start docker 2>&1 | tee -a ${CURRENT_DIR}/install.log
fi
fi
}