From cd7852e4f9fe27173fb771ea1df0ad796a33d154 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 1 Dec 2023 14:02:11 +0100 Subject: [PATCH] fix: use official install script with rancher (one will work for sure) --- app/Actions/Server/InstallDocker.php | 2 +- app/Jobs/ContainerStatusJob.php | 2 -- scripts/install.sh | 16 +++++++++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/Actions/Server/InstallDocker.php b/app/Actions/Server/InstallDocker.php index 79863d989..c347b4181 100644 --- a/app/Actions/Server/InstallDocker.php +++ b/app/Actions/Server/InstallDocker.php @@ -67,7 +67,7 @@ public function handle(Server $server) } $command = $command->merge([ "echo 'Installing Docker Engine...'", - "curl https://releases.rancher.com/install-docker/{$dockerVersion}.sh | sh", + "curl https://releases.rancher.com/install-docker/{$dockerVersion}.sh | sh || curl https://get.docker.com | sh -s -- --version {$dockerVersion}", "echo 'Configuring Docker Engine (merging existing configuration with the required)...'", "test -s /etc/docker/daemon.json && cp /etc/docker/daemon.json \"/etc/docker/daemon.json.original-`date +\"%Y%m%d-%H%M%S\"`\" || echo '{$config}' | base64 -d > /etc/docker/daemon.json", "echo '{$config}' | base64 -d > /etc/docker/daemon.json.coolify", diff --git a/app/Jobs/ContainerStatusJob.php b/app/Jobs/ContainerStatusJob.php index 96fde2a40..ead13f81a 100644 --- a/app/Jobs/ContainerStatusJob.php +++ b/app/Jobs/ContainerStatusJob.php @@ -312,8 +312,6 @@ public function handle() if ($shouldStart) { StartProxy::run($this->server, false); $this->server->team?->notify(new ContainerRestarted('coolify-proxy', $this->server)); - } else { - ray('Proxy could not be started.'); } } catch (\Throwable $e) { ray($e); diff --git a/scripts/install.sh b/scripts/install.sh index 85bc58aad..1f62b735d 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -59,15 +59,21 @@ sles | opensuse-leap | opensuse-tumbleweed) esac if ! [ -x "$(command -v docker)" ]; then - echo "Docker is not installed. Installing Docker..." + echo "Docker is not installed. Installing Docker." curl https://releases.rancher.com/install-docker/${DOCKER_VERSION}.sh | sh if [ -x "$(command -v docker)" ]; then echo "Docker installed successfully." else - echo "Docker installation failed." - echo "Maybe your OS is not supported." - echo "Please visit https://docs.docker.com/engine/install/ and install Docker manually to continue." - exit 1 + 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 echo -e "-------------"