From 4267cdf15c24cbfa6920b30b85d2c4124bee2b55 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Thu, 3 Dec 2026 09:57:16 +0100 Subject: [PATCH] Docker/NPMplus (Alpine): use docker-cli-compose instead of a downloaded binary The Alpine installs put Compose into /root/.docker/cli-plugins by curl. Nothing updated it afterwards (the update is apk -U upgrade), and the CLI prefers that directory over the package path. Install docker-cli-compose instead, and on update move existing containers to the package before removing the old binary. --- ct/docker.sh | 9 +++++++++ ct/npmplus.sh | 10 ++++++++++ install/docker-install.sh | 10 +++------- install/npmplus-install.sh | 8 +------- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/ct/docker.sh b/ct/docker.sh index a01805c18..a561150cc 100644 --- a/ct/docker.sh +++ b/ct/docker.sh @@ -60,6 +60,15 @@ update_deb_based() { update_alpine() { $STD apk -U upgrade + if [[ -f /root/.docker/cli-plugins/docker-compose ]]; then + msg_info "Migrating Docker Compose to the Alpine package" + if apk info -e docker-cli-compose &>/dev/null || $STD apk add docker-cli-compose; then + rm -f /root/.docker/cli-plugins/docker-compose + msg_ok "Migrated Docker Compose to the Alpine package ($(docker compose version --short))" + else + msg_warn "Could not install docker-cli-compose, keeping the old Compose binary" + fi + fi msg_ok "Updated successfully!" } diff --git a/ct/npmplus.sh b/ct/npmplus.sh index 16193250d..7b37f2119 100644 --- a/ct/npmplus.sh +++ b/ct/npmplus.sh @@ -26,6 +26,16 @@ function update_script() { $STD apk -U upgrade msg_ok "System updated" + if [[ -f /root/.docker/cli-plugins/docker-compose ]]; then + msg_info "Migrating Docker Compose to the Alpine package" + if apk info -e docker-cli-compose &>/dev/null || $STD apk add docker-cli-compose; then + rm -f /root/.docker/cli-plugins/docker-compose + msg_ok "Migrated Docker Compose to the Alpine package" + else + msg_warn "Could not install docker-cli-compose, keeping the old Compose binary" + fi + fi + msg_info "Pulling latest NPMplus container image" cd /opt $STD docker compose pull diff --git a/install/docker-install.sh b/install/docker-install.sh index 4c2961d45..dd354a9ee 100644 --- a/install/docker-install.sh +++ b/install/docker-install.sh @@ -66,16 +66,12 @@ setup_alpine() { $STD rc-update add docker default msg_ok "Installed Docker" - DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_github_release "docker/compose" false) prompt="${var_docker_compose:-}" [[ -n "$prompt" ]] || read -r -p "${TAB3}Would you like to add Docker Compose? " prompt || true if [[ "${prompt,,}" =~ ^(y|yes|true)$ ]]; then - msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION" - DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} - mkdir -p "$DOCKER_CONFIG"/cli-plugins - curl -fsSL https://github.com/docker/compose/releases/download/"$DOCKER_COMPOSE_LATEST_VERSION"/docker-compose-linux-$(arch_resolve "x86_64" "aarch64") -o ~/.docker/cli-plugins/docker-compose - chmod +x "$DOCKER_CONFIG"/cli-plugins/docker-compose - msg_ok "Installed Docker Compose $DOCKER_COMPOSE_LATEST_VERSION" + msg_info "Installing Docker Compose" + $STD apk add docker-cli-compose + msg_ok "Installed Docker Compose $(docker compose version --short)" fi prompt="${var_docker_socket:-}" [[ -n "$prompt" ]] || read -r -p "${TAB3}Would you like to expose the Docker TCP socket? " prompt || true diff --git a/install/npmplus-install.sh b/install/npmplus-install.sh index d9be914df..66d92f670 100644 --- a/install/npmplus-install.sh +++ b/install/npmplus-install.sh @@ -21,15 +21,9 @@ $STD apk add \ msg_ok "Installed Dependencies" msg_info "Installing Docker & Compose" -$STD apk add docker +$STD apk add docker docker-cli-compose $STD rc-service docker start $STD rc-update add docker default - -DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_github_release "docker/compose" false) -DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} -mkdir -p $DOCKER_CONFIG/cli-plugins -curl -fsSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_LATEST_VERSION/docker-compose-linux-$(arch_resolve "x86_64" "aarch64") -o ~/.docker/cli-plugins/docker-compose -chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose msg_ok "Installed Docker & Compose" msg_info "Fetching NPMplus"