mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-21 23:20:23 +00:00
update docker
This commit is contained in:
parent
cd7c207943
commit
d7d9a0c205
1 changed files with 4 additions and 40 deletions
|
@ -145,46 +145,10 @@ UpdateDocker(){
|
|||
|
||||
echo "Parpare to update Docker to latest ..."
|
||||
|
||||
if [ "$os_type" == 'CentOS' ];then
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
|
||||
fi
|
||||
|
||||
if [ "$os_type" == 'Ubuntu' ] || [ "$os_type" == 'Debian' ] ;then
|
||||
apt-get update
|
||||
while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
|
||||
echo "Waiting for other software managers to finish..."
|
||||
sleep 5
|
||||
done
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
|
||||
sleep 30
|
||||
fi
|
||||
|
||||
if [ "$os_type" == 'OracleLinux' ] ;then
|
||||
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
||||
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
fi
|
||||
|
||||
if [ "$os_type" == 'Fedora' ] ;then
|
||||
wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/fedora/docker-ce.repo
|
||||
sudo yum install device-mapper-persistent-data lvm2 docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-scan-plugin docker-ce-rootless-extras -y
|
||||
fi
|
||||
|
||||
if [ "$os_type" == 'Redhat' ] ;then
|
||||
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine podman runc -y 1>/dev/null 2>&1
|
||||
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
||||
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
fi
|
||||
|
||||
if [ "$os_type" == 'CentOS Stream' ] ;then
|
||||
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine podman runc -y 1>/dev/null 2>&1
|
||||
wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo
|
||||
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
fi
|
||||
|
||||
sudo systemctl start docker
|
||||
sudo systemctl enable docker
|
||||
if ! docker network inspect websoft9 > /dev/null 2>&1; then
|
||||
sudo docker network create websoft9
|
||||
if command -v apt > /dev/null;then
|
||||
sudo apt -y install --only-upgrade docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
elif command -v yum > /dev/null;then
|
||||
sudo yum update -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
fi
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue