Fix Docker Compose install on Debian without compose apt package

- Install docker.io only; add compose plugin from apt or GitHub release
- Fail clearly if docker compose is still missing after install
- README notes Compose v2 fallback on Debian
This commit is contained in:
Sinisa Madzar
2026-06-01 08:09:48 +02:00
parent 9e60ae40cc
commit 0b1f1040b9
2 changed files with 37 additions and 5 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ sudo ./install-rubix.sh
The script will: The script will:
1. `apt update` / `upgrade`, install tools, **Docker** + compose plugin 1. `apt update` / `upgrade`, install tools, **Docker** (`docker.io`) + Compose v2 plugin (apt or GitHub on Debian)
2. Ask for your **Gitea token** (if `GITEA_TOKEN` is not already exported) 2. Ask for your **Gitea token** (if `GITEA_TOKEN` is not already exported)
3. Create **`/home/www/callcenter`** and download the latest **rubix** release 3. Create **`/home/www/callcenter`** and download the latest **rubix** release
+36 -4
View File
@@ -24,7 +24,8 @@ GITEA_TOKEN="${GITEA_TOKEN:-${GITEA_REGISTRY_PULL_TOKEN:-}}"
TAG="${1:-}" TAG="${1:-}"
APT_PACKAGES=(unzip wget curl python3 ca-certificates git rsync) APT_PACKAGES=(unzip wget curl python3 ca-certificates git rsync)
DOCKER_PACKAGES=(docker.io docker-compose-plugin) DOCKER_APT_PACKAGE="${DOCKER_APT_PACKAGE:-docker.io}"
COMPOSE_PLUGIN_DIR="/usr/lib/docker/cli-plugins"
prepare_system() { prepare_system() {
if [[ "$(id -u)" -ne 0 ]]; then if [[ "$(id -u)" -ne 0 ]]; then
@@ -47,19 +48,50 @@ prepare_system() {
ensure_docker ensure_docker
} }
ensure_docker_compose_plugin() {
if docker compose version >/dev/null 2>&1; then
return 0
fi
if apt-cache show docker-compose-plugin >/dev/null 2>&1; then
echo "[install-rubix] apt-get install docker-compose-plugin ..."
apt-get install -y docker-compose-plugin
return 0
fi
echo "[install-rubix] docker-compose-plugin not in apt — fetching Compose v2 plugin ..."
local arch compose_arch url
arch="$(uname -m)"
case "${arch}" in
x86_64) compose_arch="x86_64" ;;
aarch64|arm64) compose_arch="aarch64" ;;
*)
echo "[install-rubix] ERROR: unsupported CPU for compose plugin: ${arch}" >&2
exit 1
;;
esac
mkdir -p "${COMPOSE_PLUGIN_DIR}"
url="https://github.com/docker/compose/releases/latest/download/docker-compose-linux-${compose_arch}"
curl -fsSL "${url}" -o "${COMPOSE_PLUGIN_DIR}/docker-compose"
chmod +x "${COMPOSE_PLUGIN_DIR}/docker-compose"
}
ensure_docker() { ensure_docker() {
if command -v docker >/dev/null 2>&1; then if command -v docker >/dev/null 2>&1; then
echo "[install-rubix] docker already installed: $(docker --version)" echo "[install-rubix] docker already installed: $(docker --version)"
else else
echo "[install-rubix] apt-get install ${DOCKER_PACKAGES[*]} ..." echo "[install-rubix] apt-get install ${DOCKER_APT_PACKAGE} ..."
apt-get install -y "${DOCKER_PACKAGES[@]}" apt-get install -y "${DOCKER_APT_PACKAGE}"
fi fi
ensure_docker_compose_plugin
systemctl enable --now docker systemctl enable --now docker
if ! docker info >/dev/null 2>&1; then if ! docker info >/dev/null 2>&1; then
echo "[install-rubix] ERROR: docker installed but daemon not running." >&2 echo "[install-rubix] ERROR: docker installed but daemon not running." >&2
exit 1 exit 1
fi fi
echo "[install-rubix] docker OK ($(docker compose version 2>/dev/null | head -1 || docker --version))" if ! docker compose version >/dev/null 2>&1; then
echo "[install-rubix] ERROR: docker compose plugin missing after install." >&2
exit 1
fi
echo "[install-rubix] docker OK ($(docker compose version | head -1))"
} }
prompt_token() { prompt_token() {