docker release updated
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
+33
-13
@@ -18,30 +18,50 @@ every gotcha below actually happened once and is now fixed or documented.
|
|||||||
|
|
||||||
## 1. Install Docker
|
## 1. Install Docker
|
||||||
|
|
||||||
**Check your actual distro first** — Docker has separate repos for Debian and Ubuntu,
|
This block auto-detects `debian` vs `ubuntu` from `/etc/os-release` **and** probes
|
||||||
and mixing them up 404s:
|
Docker's repo for your codename before adding it — if your codename is too new and 404s
|
||||||
```bash
|
(interim/dev releases lag Docker's repo by months), it automatically falls back to the
|
||||||
cat /etc/os-release # check ID (debian/ubuntu) and VERSION_CODENAME
|
latest codename Docker actually publishes for your distro. No manual edits needed:
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y ca-certificates curl gnupg
|
sudo apt-get install -y ca-certificates curl gnupg
|
||||||
sudo install -m 0755 -d /etc/apt/keyrings
|
sudo install -m 0755 -d /etc/apt/keyrings
|
||||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
|
||||||
|
. /etc/os-release
|
||||||
|
DOCKER_DISTRO="$ID" # debian or ubuntu
|
||||||
|
DOCKER_CODENAME="$VERSION_CODENAME"
|
||||||
|
|
||||||
|
# Fallback list, newest first, per distro — used only if the detected codename 404s
|
||||||
|
case "$DOCKER_DISTRO" in
|
||||||
|
ubuntu) FALLBACKS="noble jammy focal" ;;
|
||||||
|
debian) FALLBACKS="bookworm bullseye" ;;
|
||||||
|
*) echo "Unsupported distro '$DOCKER_DISTRO' — Docker only publishes debian/ubuntu repos." >&2; exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if ! curl -fsSL -o /dev/null "https://download.docker.com/linux/${DOCKER_DISTRO}/dists/${DOCKER_CODENAME}/Release"; then
|
||||||
|
echo "Docker has no repo for ${DOCKER_DISTRO} ${DOCKER_CODENAME} yet, falling back..." >&2
|
||||||
|
for fb in $FALLBACKS; do
|
||||||
|
if curl -fsSL -o /dev/null "https://download.docker.com/linux/${DOCKER_DISTRO}/dists/${fb}/Release"; then
|
||||||
|
DOCKER_CODENAME="$fb"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "Using ${DOCKER_DISTRO} ${DOCKER_CODENAME}" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -fsSL "https://download.docker.com/linux/${DOCKER_DISTRO}/gpg" | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
sudo chmod a+r /etc/apt/keyrings/docker.gpg
|
sudo chmod a+r /etc/apt/keyrings/docker.gpg
|
||||||
|
|
||||||
echo \
|
echo \
|
||||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/${DOCKER_DISTRO} \
|
||||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
${DOCKER_CODENAME} stable" | \
|
||||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||||
```
|
```
|
||||||
(Swap `debian` → `ubuntu` in both URLs if you're actually on Ubuntu. If your codename is
|
(The `FALLBACKS` lists above are current as of 2026-08 — bump them if Docker ships a
|
||||||
brand-new and Docker's repo 404s, fall back to the previous stable codename — e.g. use
|
newer stable codename by the time you read this.)
|
||||||
`bookworm` instead of `trixie`.)
|
|
||||||
|
|
||||||
Let your user run Docker without `sudo`:
|
Let your user run Docker without `sudo`:
|
||||||
```bash
|
```bash
|
||||||
@@ -182,7 +202,7 @@ machine.
|
|||||||
|
|
||||||
| Symptom | Cause | Fix |
|
| Symptom | Cause | Fix |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `apt` 404: `.../linux/ubuntu <codename> Release` not found | Docker repo added for the wrong distro (e.g. Ubuntu URL on a Debian box) | Match the URL to your real distro/codename from `/etc/os-release` |
|
| `apt` 404: `.../linux/<distro> <codename> Release` not found | Step 1's install block already auto-detects and falls back — this only happens if you ran the old manual commands, or your codename is newer than every entry in `FALLBACKS` | Re-run Step 1's block as-is, or add your distro's actual latest stable codename to `FALLBACKS` |
|
||||||
| `permission denied ... docker.sock` | User not in the `docker` group | `sudo usermod -aG docker $USER && newgrp docker` |
|
| `permission denied ... docker.sock` | User not in the `docker` group | `sudo usermod -aG docker $USER && newgrp docker` |
|
||||||
| `WARN: "DB_NAME" variable is not set` (and similar) | Root `new_starr/.env` missing | Create it (see step 3) |
|
| `WARN: "DB_NAME" variable is not set` (and similar) | Root `new_starr/.env` missing | Create it (see step 3) |
|
||||||
| `postgres` container stuck `Restarting` | `POSTGRES_PASSWORD` blank (same root `.env` issue) | Same fix as above |
|
| `postgres` container stuck `Restarting` | `POSTGRES_PASSWORD` blank (same root `.env` issue) | Same fix as above |
|
||||||
|
|||||||
Reference in New Issue
Block a user