mirror of
https://github.com/ShaYmez/hblink3-docker-install.git
synced 2025-12-22 13:39:50 +13:00
Update installer to always use Docker Compose v2 for Debian 11-13
Co-authored-by: ShaYmez <76499782+ShaYmez@users.noreply.github.com>
This commit is contained in:
parent
707813d5f9
commit
56237a8557
26
README.md
26
README.md
@ -1,9 +1,11 @@
|
||||
# HBlink3 Docker Installer
|
||||
**Version 1.5.0** - Debian 10 / 11 / 12 / 13 (Trixie) Support!!
|
||||
**Version 1.5.0** - Debian 11 / 12 / 13 (Trixie) Support!!
|
||||
=======
|
||||
This is a multi-arch docker installer for HBlink3 and HBmonV2 combined for Debian 10, 11, 12, and 13 (Trixie).
|
||||
This is a multi-arch docker installer for HBlink3 and HBmonV2 combined for Debian 11, 12, and 13 (Trixie).
|
||||
|
||||
**Note:** Debian 12 (Bookworm) and 13 (Trixie) support has been added with proper PEP 668 compliant Python package management using virtual environments, and docker-compose compatibility. HBMonv2 now runs in an isolated Python virtual environment on Debian 12+. See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
|
||||
**Important:** This installer requires Docker Compose v2 (provided by the docker-compose-plugin package). The legacy docker-compose v1 standalone package is not supported. The installer automatically installs Docker Engine and Docker Compose v2 from the official Docker repositories.
|
||||
|
||||
**Note:** Debian 12 (Bookworm) and 13 (Trixie) support has been added with proper PEP 668 compliant Python package management using virtual environments. HBMonv2 now runs in an isolated Python virtual environment on Debian 12+. See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
|
||||
|
||||

|
||||
|
||||
@ -29,7 +31,9 @@ This installer includes all the usual libs and packages including docker, apache
|
||||
install this on a 'clean machine'. The script is destructive and is not designed to be used on an exisiting machine that has other software on it! YOU HAVE BEEN WARNED!
|
||||
|
||||
### Prerequisite
|
||||
The host system must be running Debian 10, 11, 12, or 13 (Trixie). The installer has been tested on these Debian versions and works on most architectures. The system requires, at a minimum; 1 core, 512mb of ram, the required spec to run docker and additional processes! The system must be up-to-date and have Git installed. You can install Git from the CLI.
|
||||
The host system must be running Debian 11, 12, or 13 (Trixie). **Debian 10 is no longer supported** due to the requirement for Docker Compose v2. The installer has been tested on these Debian versions and works on most architectures. The system requires, at a minimum; 1 core, 512mb of ram, the required spec to run docker and additional processes! The system must be up-to-date and have Git installed. You can install Git from the CLI.
|
||||
|
||||
**Docker Compose v2:** This installer exclusively uses Docker Compose v2 from the official Docker repositories. The docker-compose-plugin package is automatically installed, providing the `docker compose` command (note the space). A compatibility wrapper is also created to support the legacy `docker-compose` command (with hyphen) for backward compatibility with existing scripts.
|
||||
|
||||
Note* If you get Locale error(s) (LC_CTYPE=UTF-8, which is wrong) can happen when you login over ssh from a Mac to a linux box, and your terminal automatically sets environment variables. There's a checkbox for that. Uncheck it, and you're good to go.
|
||||
|
||||
@ -38,7 +42,7 @@ Make sure your system is up-to-date and pull Git from the apt repo.
|
||||
apt-get install -y git
|
||||
```
|
||||
### Installation
|
||||
1. Preferably a clean Debian 10, 11, 12, or 13 (Trixie) system. Make sure your system is up to date with the latest apt repository database. You must be super user "root" to run this installer successfully.
|
||||
1. Preferably a clean Debian 11, 12, or 13 (Trixie) system. **Debian 10 is no longer supported.** Make sure your system is up to date with the latest apt repository database. You must be super user "root" to run this installer successfully.
|
||||
```sh
|
||||
apt update
|
||||
sudo su
|
||||
@ -105,15 +109,15 @@ The uninstall script will:
|
||||
```sh
|
||||
cd /etc/hblink3
|
||||
```
|
||||
10. You can only interact with HBlink3 in this directory. Use the following commands to interact with the installation. We use
|
||||
docker-compose to run the docker container!
|
||||
10. You can only interact with HBlink3 in this directory. Use the following commands to interact with the installation. This installer uses Docker Compose v2 (docker-compose-plugin):
|
||||
```sh
|
||||
docker-compose up -d
|
||||
docker-compose down
|
||||
docker-compose restart
|
||||
docker-compose pull
|
||||
docker compose up -d # Start containers (Docker Compose v2)
|
||||
docker compose down # Stop containers
|
||||
docker compose restart # Restart containers
|
||||
docker compose pull # Update images
|
||||
sudo nano docker-compose.yml
|
||||
```
|
||||
**Note:** The legacy `docker-compose` command (with hyphen) also works via a compatibility wrapper that forwards to `docker compose`, but using `docker compose` (with space) is recommended as the official Docker Compose v2 syntax.
|
||||
11. Edit your configuration before deployment!
|
||||
```sh
|
||||
nano hblink.cfg
|
||||
|
||||
@ -22,18 +22,19 @@
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##################################################################################
|
||||
#
|
||||
# A tool to install HBlink3 Docker with Debian 10-13 / Ubuntu 20.04 support.
|
||||
# A tool to install HBlink3 Docker with Debian 11, 12, and 13 support.
|
||||
# This essentially is a HBlink3 server fully installed with dashboard ready to go.
|
||||
# Step 1: Install Debian 10, 11, 12, or 13 (Trixie) or Ubuntu 20.04 and make sure it has internet and is up to date.
|
||||
# Step 1: Install Debian 11, 12, or 13 (Trixie) and make sure it has internet and is up to date.
|
||||
# Step 2: Run this script on the computer.
|
||||
# Step 3: Reboot after installation.
|
||||
# This is a docker version and you can use the following comands to control / maintain your server
|
||||
# This is a docker version and you can use the following commands to control / maintain your server
|
||||
# cd /etc/hblink3
|
||||
# docker-compose up -d (starts the hblink3 docker container)
|
||||
# docker-compose down (shuts down the hblink container and stops the service)
|
||||
# docker-compose pull (updates the container to the latest docker image)
|
||||
# docker compose up -d (starts the hblink3 docker container) - Note: uses Docker Compose v2
|
||||
# docker compose down (shuts down the hblink container and stops the service)
|
||||
# docker compose pull (updates the container to the latest docker image)
|
||||
# For backward compatibility, docker-compose (with hyphen) is also supported via a wrapper script
|
||||
# systemctl |stop|start|restart|status hbmon (controls the HBMonv2 dash service)
|
||||
# logs can be found in var/log/hblink or docker comand "docker container logs hblink"
|
||||
# logs can be found in var/log/hblink or docker command "docker container logs hblink"
|
||||
#Lets begin-------------------------------------------------------------------------------------------------
|
||||
if [ "$EUID" -ne 0 ];
|
||||
then
|
||||
@ -44,7 +45,7 @@ fi
|
||||
if [ ! -e "/etc/debian_version" ]
|
||||
then
|
||||
echo ""
|
||||
echo "This script is only tested in Debian 10, 11, 12 & 13 (Trixie)."
|
||||
echo "This script is only tested in Debian 11, 12 & 13 (Trixie)."
|
||||
exit 0
|
||||
fi
|
||||
DIRDIR=$(pwd)
|
||||
@ -85,33 +86,57 @@ install_docker_and_dependencies() {
|
||||
sleep 2
|
||||
|
||||
# Remove old Docker versions if present
|
||||
apt-get remove docker docker-engine docker.io containerd runc 2>/dev/null || true
|
||||
echo "Removing old Docker versions if present..."
|
||||
apt-get remove docker docker-engine docker.io containerd runc docker-compose 2>/dev/null || true
|
||||
|
||||
# Add Docker GPG key
|
||||
echo "Adding Docker GPG key..."
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
||||
if [ ! -f /usr/share/keyrings/docker-archive-keyring.gpg ]; then
|
||||
echo "ERROR: Failed to download Docker GPG key"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Add Docker repository
|
||||
echo "Adding Docker repository..."
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
|
||||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
# Install Docker
|
||||
# Install Docker Engine from official Docker repositories
|
||||
echo "Installing Docker Engine from official Docker repositories..."
|
||||
apt-get update
|
||||
apt-get install -y docker-ce docker-ce-cli containerd.io
|
||||
if ! apt-get install -y docker-ce docker-ce-cli containerd.io; then
|
||||
echo "ERROR: Failed to install Docker Engine"
|
||||
echo "Please check your internet connection and Debian version compatibility"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install docker-compose based on Debian version
|
||||
if [ $version -ge 12 ]; then
|
||||
# For Debian 12+ use docker-compose-plugin or install from GitHub
|
||||
# Note: We prefer docker-compose-plugin from apt repos when available for security
|
||||
if apt-get install -y docker-compose-plugin 2>/dev/null; then
|
||||
echo "docker-compose-plugin installed successfully"
|
||||
# Create wrapper script for docker-compose command compatibility
|
||||
# docker-compose-plugin provides 'docker compose' but scripts use 'docker-compose'
|
||||
# Note: Using single quotes in heredoc ('EOF') prevents variable expansion for robustness
|
||||
# Verify Docker is installed
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "ERROR: Docker installation failed - docker command not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install Docker Compose v2 plugin from official Docker repositories
|
||||
echo "Installing Docker Compose v2 plugin from official Docker repositories..."
|
||||
if ! apt-get install -y docker-compose-plugin; then
|
||||
echo "ERROR: Failed to install docker-compose-plugin from Docker repositories"
|
||||
echo "This installer only supports Docker Compose v2"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verify Docker Compose v2 is installed
|
||||
if ! docker compose version &> /dev/null; then
|
||||
echo "ERROR: Docker Compose v2 installation failed - 'docker compose' command not working"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create wrapper script for backward compatibility with docker-compose command
|
||||
# This allows existing scripts using 'docker-compose' to work with 'docker compose'
|
||||
echo "Creating docker-compose wrapper for backward compatibility..."
|
||||
if [ ! -f /usr/local/bin/docker-compose ]; then
|
||||
echo "Creating docker-compose wrapper script..."
|
||||
# Create wrapper that forwards all commands to 'docker compose'
|
||||
# Exit on failure is intentional - without this wrapper, all control scripts will fail
|
||||
if cat > /usr/local/bin/docker-compose << 'EOF'
|
||||
#!/bin/sh
|
||||
# Wrapper script to provide docker-compose command using docker compose plugin
|
||||
@ -125,43 +150,45 @@ EOF
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# Skip wrapper creation if docker-compose already exists
|
||||
# This preserves existing installations (from apt or manual install)
|
||||
echo "docker-compose command already exists, skipping wrapper creation"
|
||||
echo "docker-compose command already exists at /usr/local/bin/docker-compose"
|
||||
fi
|
||||
else
|
||||
echo "Installing docker-compose from GitHub releases..."
|
||||
# Fallback to GitHub releases for official Docker Compose binary
|
||||
# Downloaded from official Docker GitHub repository over HTTPS
|
||||
curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) -o /usr/local/bin/docker-compose
|
||||
chmod +x /usr/local/bin/docker-compose
|
||||
ln -sf /usr/local/bin/docker-compose /usr/bin/docker-compose 2>/dev/null || true
|
||||
fi
|
||||
else
|
||||
# For Debian 10-11 use apt package
|
||||
apt-get install -y docker-compose
|
||||
|
||||
# Verify the wrapper works
|
||||
if ! /usr/local/bin/docker-compose version &> /dev/null; then
|
||||
echo "ERROR: docker-compose wrapper verification failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Enable and start Docker
|
||||
echo "Enabling and starting Docker service..."
|
||||
systemctl enable docker
|
||||
systemctl start docker
|
||||
|
||||
# Verify Docker service is running
|
||||
if ! systemctl is-active --quiet docker; then
|
||||
echo "ERROR: Docker service failed to start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
figlet "docker.io"
|
||||
|
||||
echo "Set userland-proxy to false..."
|
||||
echo '{ "userland-proxy": false}' > /etc/docker/daemon.json
|
||||
systemctl restart docker
|
||||
sleep 2
|
||||
}
|
||||
|
||||
if [ $VERSION = 10 ] || [ $VERSION = 11 ]; then
|
||||
if [ $VERSION = 11 ] || [ $VERSION = 12 ] || [ $VERSION = 13 ]; then
|
||||
echo "Installing for Debian $VERSION with Docker Compose v2..."
|
||||
install_docker_and_dependencies $VERSION
|
||||
|
||||
elif [ $VERSION = 12 ] || [ $VERSION = 13 ]; then
|
||||
# Debian 12 (Bookworm) and 13 (Trixie) support
|
||||
echo "Installing for Debian $VERSION..."
|
||||
install_docker_and_dependencies $VERSION
|
||||
|
||||
elif [ $VERSION = 10 ]; then
|
||||
echo "ERROR: Debian 10 is no longer supported by this installer"
|
||||
echo "This installer now requires Debian 11, 12, or 13 for Docker Compose v2 support"
|
||||
echo "Please upgrade your system to Debian 11 or later"
|
||||
exit 1
|
||||
else
|
||||
echo "-------------------------------------------------------------------------------------------"
|
||||
echo "Operating system not supported! Please check you are running Debian 10-13. Exiting....."
|
||||
echo "Operating system not supported! Please check you are running Debian 11, 12, or 13. Exiting....."
|
||||
echo "-------------------------------------------------------------------------------------------"
|
||||
exit 0
|
||||
fi
|
||||
@ -896,6 +923,7 @@ figlet "WhipTAIL'"
|
||||
hblink-initial-setup
|
||||
sleep 1
|
||||
echo "Done."
|
||||
sleep 2
|
||||
echo ""
|
||||
echo ""
|
||||
echo "*************************************************************************"
|
||||
@ -921,6 +949,19 @@ echo " Your IP address is $LOCAL_IP "
|
||||
echo ""
|
||||
echo " Your running on $ARC with Debian $VERSION "
|
||||
echo ""
|
||||
echo "------------------------------------------------------------------------------"
|
||||
echo " Installed Versions "
|
||||
echo "------------------------------------------------------------------------------"
|
||||
echo "Docker version:"
|
||||
docker --version
|
||||
echo ""
|
||||
echo "Docker Compose version:"
|
||||
docker compose version
|
||||
echo ""
|
||||
echo "Note: This installation uses Docker Compose v2 (docker compose command)"
|
||||
echo " The legacy docker-compose v1 is not supported"
|
||||
echo "------------------------------------------------------------------------------"
|
||||
echo ""
|
||||
echo " Thanks for using this script. "
|
||||
echo " Copyright © 2024 Shane Daley - M0VUB "
|
||||
echo " More information can be found @ https://github.com/shaymez/ "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user