Docker & Trixie

Docker & Trixie

Docker is not yet officially supported so Alex and Baden will remain on Bookworm for the time being

Debian
Learn how to install Docker Engine on Debian. These instructions cover the different installation methods, how to uninstall, and next steps.

However - Cisco and Davros are my test servers so I will be giving them a spin on Trixie and see how we go. A guide is here as everyone else is giving them a spin.

How to upgrade to Trixie - updated 2025-10-23

#!/bin/bash
# Debian 12 → Debian 13 Upgrade Script with Docker Reinstall & Service Checks
# Purpose: Automate upgrade with traceable, auditable steps, using modern APT keyring practices

set -euo pipefail

echo "=== Debian Upgrade Script: Bookworm → Trixie ==="

# 0. Pre-flight check: Ensure we are on Debian 12 (Bookworm)
echo "[0/12] Verifying current Debian release..."
source /etc/os-release
if [[ "${VERSION_CODENAME:-}" != "bookworm" ]]; then
    echo "ERROR: This script is intended for Debian 12 (Bookworm)."
    echo "Current release detected: ${PRETTY_NAME:-unknown}"
    echo "Aborting to prevent accidental misuse."
    exit 1
fi
echo "Confirmed: Running on Debian 12 (Bookworm). Proceeding with upgrade..."

# 1. Gracefully stop running Docker containers (if any)
echo "[1/12] Checking for running Docker containers..."
if command -v docker >/dev/null 2>&1 && systemctl is-active --quiet docker.service; then
    RUNNING_COUNT="$(docker ps -q | wc -l || echo 0)"
    if [[ "$RUNNING_COUNT" -gt 0 ]]; then
        echo "Stopping all running containers gracefully..."
        docker ps -q | xargs -r docker stop -t 20 || true
    else
        echo "No running containers detected."
    fi
else
    echo "Docker daemon not active or CLI unavailable; skipping container stop."
fi

# 2. Stop and disable Docker services (if present)
echo "[2/12] Stopping and disabling Docker services..."
if systemctl list-unit-files | grep -qE '^(docker|containerd)\.(service|socket)'; then
    systemctl stop docker.service docker.socket containerd.service || true
    systemctl disable docker.service docker.socket containerd.service || true
    echo "Docker services stopped and disabled."
else
    echo "No Docker services detected."
fi

# 3. Remove Docker packages to avoid conflicts
echo "[3/12] Removing Docker packages to avoid conflicts..."
if dpkg -l | grep -q '^ii\s\+docker-ce'; then
    apt remove -y docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin docker-model-plugin containerd.io || true
    apt purge -y docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin docker-model-plugin containerd.io || true
    apt autoremove -y
else
    echo "Docker CE packages not installed or already removed."
fi

# 4. Update current system (still on Bookworm)
echo "[4/12] Updating current Debian 12 system..."
apt update
apt upgrade -y
apt dist-upgrade -y

# 5. Clean package cache
echo "[5/12] Cleaning package cache..."
apt clean
apt autoremove -y

# 6. Verify system integrity
echo "[6/12] Checking system status..."
apt --fix-broken install -y || true
dpkg --configure -a

# 7. Update repository sources from Bookworm → Trixie (modern deb822 format)
echo "[7/12] Migrating APT sources to deb822 format for Trixie..."
mkdir -p /etc/apt/sources.list.d.backup
cp /etc/apt/sources.list /etc/apt/sources.list.backup || true
cp -r /etc/apt/sources.list.d/* /etc/apt/sources.list.d.backup/ || true
rm -f /etc/apt/sources.list
rm -f /etc/apt/sources.list.d/*.list

# Create deb822-style sources files
cat > /etc/apt/sources.list.d/debian.sources <<'EOF'
Types: deb
URIs: http://deb.debian.org/debian
Suites: trixie
Components: main contrib non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: http://deb.debian.org/debian-security
Suites: trixie-security
Components: main contrib non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: http://deb.debian.org/debian
Suites: trixie-updates
Components: main contrib non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF

# 8. Refresh package database on Trixie
echo "[8/12] Refreshing package database..."
apt update

# 9. Perform the upgrade
echo "[9/12] Performing minimal upgrade..."
apt upgrade --without-new-pkgs -y -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-confdef"

echo "[9/12] Performing full distribution upgrade..."
apt full-upgrade -y -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-confdef"

# 10. Post-upgrade cleanup and verification
echo "[10/12] Verifying upgrade and cleaning up..."
cat /etc/os-release

apt autoremove -y
apt autoclean -y
apt --fix-broken install -y || true
dpkg --configure -a
apt update
apt list --upgradable

# 11. Reinstall Docker CE from official repository (for Trixie)
echo "[11/12] Reinstalling Docker CE from official repository..."
apt install -y ca-certificates curl gnupg lsb-release

install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg

cat > /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: $(lsb_release -cs)
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.gpg
EOF

apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

systemctl enable docker.service docker.socket containerd.service || true
systemctl start docker.service containerd.service || true

echo "Docker version installed:"
docker --version || echo "Docker installation failed."

# 12. Post-upgrade systemd service health check
echo "[12/12] Checking systemd service health..."
systemctl --failed || true

SYSTEM_STATE="$(systemctl is-system-running || true)"
if [[ "$SYSTEM_STATE" == "running" ]]; then
    echo "Systemd reports: system is healthy (not degraded)."
else
    echo "WARNING: Systemd reports state: $SYSTEM_STATE"
    echo "Please investigate failed services above."
fi

echo "=== Upgrade + Docker reinstall + service health check complete. Please reboot the system. ==="
How to Install Docker on Debian 13 (Trixie): A Step-by-Step Guide
Learn how to install Docker on Debian 13 (Trixie) from start to finish and get your containerization environment ready in minutes.

The Proxmox Community appear to be waiting as well.

Proxmox VE Helper-Scripts
The official website for the Proxmox VE Helper-Scripts (Community) Repository. Featuring over 300+ scripts to help you manage your Proxmox VE environment.

I will bring up my two main servers and leave the others although I might spin up a Debian Trixy LXC and see what gives. A Debian 12 seems to break at the moment, so I will need to look at that.

#enoughsaid