mirror of https://github.com/easzlab/kubeasz.git
fix easzup: install_docker()
parent
226e63fbe6
commit
aa76da0f2e
10
tools/easzup
10
tools/easzup
|
@ -24,7 +24,9 @@ function install_docker() {
|
||||||
# check if a container runtime is already installed
|
# check if a container runtime is already installed
|
||||||
systemctl status docker|grep Active|grep -q running && { echo "[WARN] docker is already running."; return 0; }
|
systemctl status docker|grep Active|grep -q running && { echo "[WARN] docker is already running."; return 0; }
|
||||||
systemctl status containerd|grep Active|grep -q running && { echo "[ERROR] containerd is running, unsupported."; exit 1; }
|
systemctl status containerd|grep Active|grep -q running && { echo "[ERROR] containerd is running, unsupported."; exit 1; }
|
||||||
|
|
||||||
|
which docker && { echo "[WARN] docker is installed."; systemctl restart docker; return 0; }
|
||||||
|
|
||||||
if [[ "$REGISTRY_MIRROR" == CN ]];then
|
if [[ "$REGISTRY_MIRROR" == CN ]];then
|
||||||
DOCKER_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/static/stable/x86_64/docker-${DOCKER_VER}.tgz"
|
DOCKER_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/static/stable/x86_64/docker-${DOCKER_VER}.tgz"
|
||||||
else
|
else
|
||||||
|
@ -108,13 +110,13 @@ EOF
|
||||||
|
|
||||||
if [[ -e /etc/centos-release || -e /etc/redhat-release ]]; then
|
if [[ -e /etc/centos-release || -e /etc/redhat-release ]]; then
|
||||||
echo "[INFO] turn off selinux in CentOS/Redhat"
|
echo "[INFO] turn off selinux in CentOS/Redhat"
|
||||||
setenforce 0
|
getenforce|grep Disabled || setenforce 0
|
||||||
echo "SELINUX=disabled" > /etc/selinux/config
|
sed -i 's/^SELINUX=.*$/SELINUX=disabled/g' /etc/selinux/config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[INFO] enable and start docker"
|
echo "[INFO] enable and start docker"
|
||||||
systemctl enable docker
|
systemctl enable docker
|
||||||
systemctl daemon-reload && systemctl restart docker && sleep 8
|
systemctl daemon-reload && systemctl restart docker && sleep 4
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_kubeasz() {
|
function get_kubeasz() {
|
||||||
|
|
Loading…
Reference in New Issue