mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-09-29 08:11:14 +00:00
fix docker install
This commit is contained in:
parent
87ae5addb0
commit
4bdf16affa
|
@ -50,7 +50,6 @@ docker_exist() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Install_Docker(){
|
Install_Docker(){
|
||||||
echo "$echo_prefix_docker Installing Docker for your system"
|
echo "$echo_prefix_docker Installing Docker for your system"
|
||||||
|
|
||||||
|
@ -61,6 +60,7 @@ Install_Docker(){
|
||||||
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
|
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
|
||||||
else
|
else
|
||||||
# For other distributions
|
# For other distributions
|
||||||
|
sudo yum install yum-utils -y > /dev/null
|
||||||
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
||||||
sudo yum install $docker_packages -y
|
sudo yum install $docker_packages -y
|
||||||
fi
|
fi
|
||||||
|
@ -68,7 +68,6 @@ Install_Docker(){
|
||||||
|
|
||||||
# For Ubuntu, Debian, or Raspbian
|
# For Ubuntu, Debian, or Raspbian
|
||||||
if type apt >/dev/null 2>&1; then
|
if type apt >/dev/null 2>&1; then
|
||||||
apt update
|
|
||||||
# Wait for apt to be unlocked
|
# Wait for apt to be unlocked
|
||||||
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
|
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
|
||||||
fi
|
fi
|
||||||
|
@ -90,17 +89,30 @@ if docker_exist; then
|
||||||
elif [ $yum_status -eq 0 ]; then
|
elif [ $yum_status -eq 0 ]; then
|
||||||
sudo yum update -y $docker_packages
|
sudo yum update -y $docker_packages
|
||||||
elif [ $apt_status -eq 0 ]; then
|
elif [ $apt_status -eq 0 ]; then
|
||||||
|
sudo apt update -y
|
||||||
sudo apt -y install --only-upgrade $docker_packages
|
sudo apt -y install --only-upgrade $docker_packages
|
||||||
else
|
else
|
||||||
echo "Docker installed, but cannot upgrade"
|
echo "Docker installed, but cannot upgrade"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
export -f Install_Docker
|
|
||||||
timeout 300 bash -c Install_Docker
|
max_retries=3
|
||||||
if [ $? -eq 124 ]; then
|
retry_count=0
|
||||||
echo "Install Docker timed out, Docker packages maybe can't download"
|
|
||||||
exit 1
|
while ((retry_count < max_retries)); do
|
||||||
|
Install_Docker
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Installation timeout or failed, retrying..."
|
||||||
|
((retry_count++))
|
||||||
|
else
|
||||||
|
echo "Docker installed successfully."
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Docker Installation failed after $max_retries retries."
|
||||||
|
exit 1
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "0.8.26-rc69",
|
"version": "0.8.26-rc70",
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"portainer": "0.0.7",
|
"portainer": "0.0.7",
|
||||||
"nginx": "0.0.5",
|
"nginx": "0.0.5",
|
||||||
|
|
Loading…
Reference in a new issue