Merge pull request #157 from outis1one/claude/bootstrap-script-404-d8dc7h

common.sh: fix Docker install failing silently in piped execution
This commit is contained in:
Outis
2026-06-28 10:31:30 -04:00
committed by GitHub
+17 -8
View File
@@ -170,14 +170,16 @@ require_docker() {
return 0 return 0
fi fi
# Official Docker convenience script — installs Docker CE + Compose plugin # Official Docker convenience script — installs Docker CE + Compose plugin.
if curl -fsSL https://get.docker.com | sh; then # DEBIAN_FRONTEND suppresses interactive apt hooks (needrestart etc.) that
if [ -n "$ACTUAL_USER" ] && [ "$ACTUAL_USER" != "root" ]; then # would block waiting on the piped stdin and cause a silent install failure.
usermod -aG docker "$ACTUAL_USER" \ export DEBIAN_FRONTEND=noninteractive
&& log_info "Added $ACTUAL_USER to the docker group (re-login or run 'newgrp docker' to activate)" curl -fsSL https://get.docker.com | sh
fi local _rc=${PIPESTATUS[1]}
log_success "Docker installed ($(docker --version 2>/dev/null))" unset DEBIAN_FRONTEND
else hash -r 2>/dev/null || true # flush command hash so new binary is found
if [ "$_rc" -ne 0 ]; then
log_error "Docker installation failed. Try manually: curl -fsSL https://get.docker.com | sh" log_error "Docker installation failed. Try manually: curl -fsSL https://get.docker.com | sh"
return 1 return 1
fi fi
@@ -186,6 +188,13 @@ require_docker() {
log_error "Docker binary not found after install — something went wrong." log_error "Docker binary not found after install — something went wrong."
return 1 return 1
fi fi
if [ -n "$ACTUAL_USER" ] && [ "$ACTUAL_USER" != "root" ]; then
usermod -aG docker "$ACTUAL_USER" \
&& log_info "Added $ACTUAL_USER to the docker group (re-login or run 'newgrp docker' to activate)"
fi
log_success "Docker installed ($(docker --version 2>/dev/null))"
} }
# ── Command execution honoring dry-run ─────────────────────────────────────── # ── Command execution honoring dry-run ───────────────────────────────────────