Docker CLI guard added to enterprise and migrate

This commit is contained in:
TechHutTV
2026-08-25 15:21:02 +02:00
parent 1c142a03fd
commit 329cbdfd51
2 changed files with 13 additions and 2 deletions

View File

@@ -106,7 +106,12 @@ apply_docker_subnet_override() {
# NETBIRD_DOCKER_SUBNET covers those cases.
check_docker_subnet_conflicts() {
local expected_network="$1"
command -v docker &> /dev/null || return 0
if ! command -v docker &> /dev/null; then
echo "ERROR: the Docker CLI was not found in PATH." > /dev/stderr
echo "It is required to verify that $DOCKER_SUBNET is free before this install pins it." > /dev/stderr
echo "Install Docker (https://docs.docker.com/engine/install/) and run this script again." > /dev/stderr
exit 1
fi
# docker's own stderr is left visible on purpose: "is the daemon running"
# and socket permission errors are the actionable part. Only the exit status

View File

@@ -194,7 +194,13 @@ apply_docker_subnet_override() {
# later. Host routes are not checked; NETBIRD_DOCKER_SUBNET covers those cases.
check_docker_subnet_conflicts() {
local expected_network="$1"
command -v docker &> /dev/null || return 0
if ! command -v docker &> /dev/null; then
log_error "The Docker CLI was not found in PATH."
echo "It is required to verify that $DOCKER_SUBNET is free before the new compose file is written."
echo "The old deployment is stopped at this point; restart it with:"
echo " bash $BACKUP_DIR/rollback.sh"
exit 1
fi
# docker's own stderr is left visible on purpose: "is the daemon running"
# and socket permission errors are the actionable part. Only the exit status