uninstall-docker-snap (#39)

* 🔧 feat(install-casaos): Add function to check and uninstall Docker from Snap

This commit adds a new function `Check_Docker_Snap()` to the `install-casaos/run.sh` script. The purpose of this function is to check if Docker is installed via Snap and provide a prompt to uninstall the Snap version if necessary.

Snap-based Docker installations can cause compatibility issues with CasaOS, so it's recommended to uninstall the Snap version before proceeding with the CasaOS installation. This function helps to ensure a smooth installation process by addressing this potential issue.

The function first checks if Docker is installed via Snap. If so, it displays a warning message and prompts the user to confirm whether they want to uninstall the Snap version. If the user confirms, the function proceeds to uninstall Docker from Snap. If the user declines, the function skips the uninstallation and provides a warning that this may cause issues with CasaOS.

The function is then called within the `Install_Docker()` function to handle the Snap-based Docker installation before proceeding with the main Docker installation.

* 🔖 feat(install-casaos/run.sh): Update CasaOS Installer version

Updates the CasaOS Installer version from V0.1 to V0.3 to reflect the latest
release.
This commit is contained in:
Christopher
2025-04-30 23:41:32 -05:00
committed by GitHub
parent 1dca696e5a
commit 0f0a5cd8fb

View File

@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
#
# This script includes functionality to automatically check SSL certificate validity.
# SSL certificate verification will only be disabled if necessary for problematic domains.
@@ -32,7 +32,7 @@ NC='\033[0m' # No Color
# Display Welcome
echo -e "${BLUE}========================================${NC}"
echo -e "${GREEN}BigBear CasaOS Installer V0.1${NC}"
echo -e "${GREEN}BigBear CasaOS Installer V0.3${NC}"
echo -e "${BLUE}========================================${NC}"
echo "Here are some links:"
echo "https://community.bigbeartechworld.com"
@@ -522,9 +522,42 @@ Check_Docker_Install_Final() {
fi
}
# Function to check and uninstall Docker from Snap
Check_Docker_Snap() {
if command -v snap &> /dev/null && ${sudo_cmd} snap list docker &> /dev/null; then
Show 2 "Docker is installed via Snap."
echo -e "${aCOLOUR[4]}Snap-based Docker installations can cause compatibility issues with CasaOS.${COLOUR_RESET}"
echo -e "${aCOLOUR[4]}It's recommended to uninstall the Snap version before proceeding.${COLOUR_RESET}"
# Prompt for confirmation
read -p "Do you want to uninstall the Snap version of Docker? [y/n]: " yn
case $yn in
[Yy]*)
Show 2 "Uninstalling Docker from Snap..."
GreyStart
${sudo_cmd} snap remove docker
ColorReset
Show 0 "Docker has been uninstalled from Snap."
;;
[Nn]*)
Show 3 "Skipping Docker uninstallation from Snap. This may cause issues with CasaOS."
;;
*)
Show 3 "Invalid response. Skipping Docker uninstallation from Snap."
;;
esac
else
Show 2 "Docker is not installed via Snap, or Snap is not installed."
fi
}
#Install Docker
Install_Docker() {
Show 2 "Install the necessary dependencies: \e[33mDocker \e[0m"
# Check if Docker is installed via Snap and handle it
Check_Docker_Snap
if [[ ! -d "${PREFIX}/etc/apt/sources.list.d" ]]; then
${sudo_cmd} mkdir -p "${PREFIX}/etc/apt/sources.list.d"
fi