From 80dbfbc62c090635071aadf52c19b43d2ffba297 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Tue, 15 Aug 2023 06:44:14 -0600 Subject: [PATCH 1/3] Adapt install script to Debian --- scripts/quick-install-ubuntu.sh | 38 +++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/scripts/quick-install-ubuntu.sh b/scripts/quick-install-ubuntu.sh index e28c2052..7f0f69ba 100755 --- a/scripts/quick-install-ubuntu.sh +++ b/scripts/quick-install-ubuntu.sh @@ -28,12 +28,27 @@ fi # Check python3 is available # Check machine resources are sufficient +# Determine if we are on Debian or Ubuntu +linux_distro=$(lsb_release -a 2>/dev/null | grep "^Distributor ID:" | cut -f 2) +case $linux_distro in + Debian) + echo "Installing docker for Debian" + ;; + Ubuntu) + echo "Installing docker for Ubuntu" + ;; + *) + echo "ERROR: Detected unknown distribution $linux_distro, can't install docker" + exit 1 + ;; +esac + # dismiss the popups export DEBIAN_FRONTEND=noninteractive ## https://docs.docker.com/engine/install/ubuntu/ ## https://superuser.com/questions/518859/ignore-packages-that-are-not-currently-installed-when-using-apt-get-remove1 -packages_to_remove="docker docker-engine docker.io containerd runc" +packages_to_remove="docker docker-engine docker.io containerd runc docker-compose docker-doc podman-docker" installed_packages_to_remove="" for package_to_remove in $(echo $packages_to_remove); do $(dpkg --info $package_to_remove &> /dev/null) @@ -65,10 +80,25 @@ sudo apt -y install curl sudo apt -y install ca-certificates gnupg # Add dockerco package repository -sudo mkdir -m 0755 -p /etc/apt/keyrings -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg +# For reasons not obvious, the dockerco instructions for installation on +# Debian and Ubuntu are slightly different here +case $linux_distro in + Debian) + sudo install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg + sudo chmod a+r /etc/apt/keyrings/docker.gpg + ;; + Ubuntu) + sudo mkdir -m 0755 -p /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg + ;; + *) + echo "ERROR: Detected unknown distribution $linux_distro, can't install docker" + exit 1 + ;; +esac echo \ - "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/${linux_distro,,} \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null From 4a461b0dce69c682062ac74bdea6f122cda0d047 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Tue, 15 Aug 2023 06:46:00 -0600 Subject: [PATCH 2/3] Update docs for new scipt name --- README.md | 2 +- docs/laconicd-fixturenet.md | 2 +- scripts/{quick-install-ubuntu.sh => quick-install-linux.sh} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename scripts/{quick-install-ubuntu.sh => quick-install-linux.sh} (100%) diff --git a/README.md b/README.md index 4f490d8c..8dd6f041 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Stack Orchestrator allows building and deployment of a Laconic Stack on a single ## Install -**To get started quickly** on a fresh Ubuntu instance (e.g, Digital Ocean); [try this script](./scripts/quick-install-ubuntu.sh). **WARNING:** always review scripts prior to running them so that you know what is happening on your machine. +**To get started quickly** on a fresh Ubuntu instance (e.g, Digital Ocean); [try this script](./scripts/quick-install-linux.sh). **WARNING:** always review scripts prior to running them so that you know what is happening on your machine. For any other installation, follow along below and **adapt these instructions based on the specifics of your system.** diff --git a/docs/laconicd-fixturenet.md b/docs/laconicd-fixturenet.md index b2375b16..79a6336a 100644 --- a/docs/laconicd-fixturenet.md +++ b/docs/laconicd-fixturenet.md @@ -23,7 +23,7 @@ ssh root@IP 2. Get the install script, give it executable permissions, and run it: ``` -curl -o install.sh https://raw.githubusercontent.com/cerc-io/stack-orchestrator/main/scripts/quick-install-ubuntu.sh +curl -o install.sh https://raw.githubusercontent.com/cerc-io/stack-orchestrator/main/scripts/quick-install-linux.sh ``` ``` chmod +x install.sh diff --git a/scripts/quick-install-ubuntu.sh b/scripts/quick-install-linux.sh similarity index 100% rename from scripts/quick-install-ubuntu.sh rename to scripts/quick-install-linux.sh From 770899ab5495796acdbd877abbb0fb7e1e15b625 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Tue, 15 Aug 2023 07:30:07 -0600 Subject: [PATCH 3/3] Add reference to dockerco install doc --- scripts/quick-install-linux.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/quick-install-linux.sh b/scripts/quick-install-linux.sh index 7f0f69ba..4f4d044b 100755 --- a/scripts/quick-install-linux.sh +++ b/scripts/quick-install-linux.sh @@ -47,6 +47,7 @@ esac export DEBIAN_FRONTEND=noninteractive ## https://docs.docker.com/engine/install/ubuntu/ +## https://docs.docker.com/engine/install/debian/ ## https://superuser.com/questions/518859/ignore-packages-that-are-not-currently-installed-when-using-apt-get-remove1 packages_to_remove="docker docker-engine docker.io containerd runc docker-compose docker-doc podman-docker" installed_packages_to_remove=""