Skip to content

Commit

Permalink
Check docker before installing it
Browse files Browse the repository at this point in the history
  • Loading branch information
danielxnj committed Nov 16, 2023
1 parent ff67436 commit 12e6a81
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions bin/deploy-hobby
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 12e6a81

Please sign in to comment.