From 12e6a817fae3dad75666f2f158d11c711c99e727 Mon Sep 17 00:00:00 2001 From: danielxnj Date: Thu, 16 Nov 2023 10:56:48 -0500 Subject: [PATCH] Check docker before installing it --- bin/deploy-hobby | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/bin/deploy-hobby b/bin/deploy-hobby index 7040bec622a42..1c20beaf37489 100755 --- a/bin/deploy-hobby +++ b/bin/deploy-hobby @@ -166,14 +166,21 @@ EOF chmod +x compose/wait # setup docker -echo "Setting up Docker" -sudo apt install -y apt-transport-https ca-certificates curl software-properties-common -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -E apt-key add - -sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" -sudo apt update -sudo apt-cache policy docker-ce -sudo apt install -y docker-ce - +# setup docker +# Check if Docker is already installed +if ! command -v docker &> /dev/null; then + echo "Docker is not installed. Setting up Docker." + + # Setup Docker + sudo apt install -y apt-transport-https ca-certificates curl software-properties-common + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -E apt-key add - + sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" + sudo apt update + sudo apt-cache policy docker-ce + sudo apt install -y docker-ce +else + echo "Docker is already installed. Skipping installation." +fi # setup docker-compose echo "Setting up Docker Compose"