Fix Docker client installation on Debian 13

This commit is contained in:
2026-10-04 19:14:36 -04:00
parent fae7775c72
commit 1392a082da
4 changed files with 137 additions and 8 deletions
+13 -4
View File
@@ -191,15 +191,24 @@ if len(versions) != 1 or versions[0] != manifest.get('version') or not re.fullma
compile(agent, 'ec-agent.py', 'exec')
compile(updater, 'ec-agent-update.py', 'exec')
PY
# INSTALLATION_DOCKER: Debian 13 splits the client out of docker.io.
if ! command -v docker >/dev/null; then
if [ -e /var/lib/docker ] || [ -e /etc/docker/daemon.json ]; then
if [ "$VERSION_ID" = 13 ] && [ "$(dpkg-query -W -f='${Status}' docker.io 2>/dev/null)" = 'install ok installed' ]; then
# Recover an earlier daemon-only install, even if it created Docker data.
# Add only the client; do not replace or restart the existing engine.
apt-get install -y --no-install-recommends --no-remove docker-cli
elif [ -e /var/lib/docker ] || [ -e /etc/docker/daemon.json ]; then
echo 'Existing Docker data/configuration detected without a Docker CLI. Repair Docker, then rerun.' >&2
exit 1
else
docker_packages=(docker.io)
if [ "$VERSION_ID" = 13 ]; then docker_packages+=(docker-cli); fi
apt-get install -y --no-install-recommends "${docker_packages[@]}"
systemctl enable --now docker
fi
apt-get install -y --no-install-recommends docker.io
systemctl enable --now docker
fi
docker info >/dev/null 2>&1 || { echo 'Docker is installed but unavailable. Start or repair it, then rerun.' >&2; exit 1; }
command -v docker >/dev/null || { echo 'Docker CLI is missing after installation. Repair the Docker client package, then rerun.' >&2; exit 1; }
docker info >/dev/null || { echo 'Docker is installed but unavailable. Inspect systemctl status docker and journalctl -u docker, then rerun.' >&2; exit 1; }
install -d -m 0700 /etc/electric-cherry
# Wait for an already-running updater to finish; never interrupt its rollback.
# The same lock also prevents a timer firing while files are being installed.