Update Docker installation for AlmaLinux
This commit is contained in:
parent
0aa9b1735b
commit
fa6a249fb4
@ -6,7 +6,7 @@ set -e # Exit immediately if a command exits with a non-zero status
|
|||||||
#set -u # Treat unset variables as an error and exit
|
#set -u # Treat unset variables as an error and exit
|
||||||
set -o pipefail # Cause a pipeline to return the status of the last command that exited with a non-zero status
|
set -o pipefail # Cause a pipeline to return the status of the last command that exited with a non-zero status
|
||||||
|
|
||||||
VERSION="1.2.1"
|
VERSION="1.2.2"
|
||||||
DOCKER_VERSION="24.0"
|
DOCKER_VERSION="24.0"
|
||||||
|
|
||||||
CDN="https://cdn.coollabs.io/coolify"
|
CDN="https://cdn.coollabs.io/coolify"
|
||||||
@ -27,7 +27,7 @@ if [ $EUID != 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case "$OS_TYPE" in
|
case "$OS_TYPE" in
|
||||||
arch | ubuntu | debian | raspbian | centos | fedora | rhel | ol | rocky | sles | opensuse-leap | opensuse-tumbleweed) ;;
|
arch | ubuntu | debian | raspbian | centos | fedora | rhel | ol | rocky | sles | opensuse-leap | opensuse-tumbleweed | almalinux) ;;
|
||||||
*)
|
*)
|
||||||
echo "This script only supports Debian, Redhat, Arch Linux, or SLES based operating systems for now."
|
echo "This script only supports Debian, Redhat, Arch Linux, or SLES based operating systems for now."
|
||||||
exit
|
exit
|
||||||
@ -64,7 +64,7 @@ ubuntu | debian | raspbian)
|
|||||||
apt update -y >/dev/null 2>&1
|
apt update -y >/dev/null 2>&1
|
||||||
apt install -y curl wget git jq >/dev/null 2>&1
|
apt install -y curl wget git jq >/dev/null 2>&1
|
||||||
;;
|
;;
|
||||||
centos | fedora | rhel | ol | rocky)
|
centos | fedora | rhel | ol | rocky | almalinux)
|
||||||
dnf install -y curl wget git jq >/dev/null 2>&1
|
dnf install -y curl wget git jq >/dev/null 2>&1
|
||||||
;;
|
;;
|
||||||
sles | opensuse-leap | opensuse-tumbleweed)
|
sles | opensuse-leap | opensuse-tumbleweed)
|
||||||
@ -123,33 +123,48 @@ if [ "$SSH_PERMIT_ROOT_LOGIN" != "true" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -x "$(command -v docker)" ]; then
|
if ! [ -x "$(command -v docker)" ]; then
|
||||||
echo "Docker is not installed. Installing Docker."
|
if [ "$OS_TYPE" == 'almalinux' ]; then
|
||||||
if [ "$OS_TYPE" = "arch" ]; then
|
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
|
||||||
pacman -Sy docker docker-compose --noconfirm
|
dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
||||||
systemctl enable docker.service
|
if ! [ -x "$(command -v docker)" ]; then
|
||||||
if [ -x "$(command -v docker)" ]; then
|
echo "Docker could not be installed automatically. Please visit https://docs.docker.com/engine/install/ and install Docker manually to continue."
|
||||||
echo "Docker installed successfully."
|
exit 1
|
||||||
else
|
|
||||||
echo "Failed to install Docker with pacman. Try to install it manually."
|
|
||||||
echo "Please visit https://wiki.archlinux.org/title/docker for more information."
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
systemctl start docker
|
||||||
|
systemctl enable docker
|
||||||
else
|
else
|
||||||
curl https://releases.rancher.com/install-docker/${DOCKER_VERSION}.sh | sh
|
set +e
|
||||||
if [ -x "$(command -v docker)" ]; then
|
if ! [ -x "$(command -v docker)" ]; then
|
||||||
echo "Docker installed successfully."
|
echo "Docker is not installed. Installing Docker."
|
||||||
else
|
if [ "$OS_TYPE" = "arch" ]; then
|
||||||
echo "Docker installation failed with Rancher script. Trying with official script."
|
pacman -Sy docker docker-compose --noconfirm
|
||||||
curl https://get.docker.com | sh -s -- --version ${DOCKER_VERSION}
|
systemctl enable docker.service
|
||||||
if [ -x "$(command -v docker)" ]; then
|
if [ -x "$(command -v docker)" ]; then
|
||||||
echo "Docker installed successfully."
|
echo "Docker installed successfully."
|
||||||
|
else
|
||||||
|
echo "Failed to install Docker with pacman. Try to install it manually."
|
||||||
|
echo "Please visit https://wiki.archlinux.org/title/docker for more information."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Docker installation failed with official script."
|
curl https://releases.rancher.com/install-docker/${DOCKER_VERSION}.sh | sh
|
||||||
echo "Maybe your OS is not supported?"
|
if [ -x "$(command -v docker)" ]; then
|
||||||
echo "Please visit https://docs.docker.com/engine/install/ and install Docker manually to continue."
|
echo "Docker installed successfully."
|
||||||
exit 1
|
else
|
||||||
|
echo "Docker installation failed with Rancher script. Trying with official script."
|
||||||
|
curl https://get.docker.com | sh -s -- --version ${DOCKER_VERSION}
|
||||||
|
if [ -x "$(command -v docker)" ]; then
|
||||||
|
echo "Docker installed successfully."
|
||||||
|
else
|
||||||
|
echo "Docker installation failed with official script."
|
||||||
|
echo "Maybe your OS is not supported?"
|
||||||
|
echo "Please visit https://docs.docker.com/engine/install/ and install Docker manually to continue."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
set -e
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user