basforge

Search titles, text and the “If it doesn’t work” cases.

    RU

    Track image versions with Renovate

    Let Renovate manage Docker image versions in your server repository through pull requests: whenever a new tag ships or an existing tag gets rebuilt, it opens a PR with a diff and changelog, you merge it by hand, and the server deploys the commit itself. Updates stop piling up for months and never happen silently, while any broken release rolls back with git revert.

    image registry ── new version / digest ──▶ Renovate ── PR in infra-web1 ──▶ manual merge ──▶ deploy.sh on server

    Why pull requests beat Watchtower and manual pulls

    Manual stack-by-stack updates tend to get abandoned: images sit on old versions for months until you have to jump across several major releases at once.

    On-server auto-updaters like Watchtower swing to the opposite extreme: they pull new images and restart containers silently, with no record in git and no pause before a breaking release. If a service goes down overnight, docker-compose.yaml still shows the same tag and you can’t tell which build was running yesterday.

    Renovate keeps infra-web1 as the single source of truth: every new version or tag rebuild arrives as a pull request linking to release notes. You merge when you’re ready to check your services, the server pulls the commit and updates the affected stack, and rolling back restores the exact previous build (Pin images by digest).

    Configuring renovate.json

    The root of infra-web1 holds the config from the Deploy without SSH recipe:

    {
      "$schema": "https://docs.renovatebot.com/renovate-schema.json",
      "extends": ["config:recommended", "docker:pinDigests"],
      "timezone": "Europe/Berlin",
      "schedule": ["before 6am on monday"],
      "packageRules": [
        {
          "description": "Rebuilds of existing tags — one weekly PR",
          "matchUpdateTypes": ["digest"],
          "groupName": "digests"
        }
      ]
    }

    What each setting does:

    • docker:pinDigests — appends @sha256:… to every tag (traefik:v3.7@sha256:…) and tracks rebuilds of the same tag. Without this preset, fresh builds published under stable or latest go unnoticed.
    • timezone (set your own timezone; Europe/Berlin here is an example) and schedule — batch updates into one weekly window instead of dripping notifications every day.
    • groupName: "digests" for matchUpdateTypes: ["digest"] — bundles rebuilds of the same tag into one pull request while keeping version bumps (v3.7 to v3.8) separate so releases that may need migrations get reviewed individually.

    Leave automerge off to start. Reviewing and merging one or two pull requests a week takes a couple of minutes and catches breaking changes in minor releases.

    Alongside pull requests, Renovate maintains a “Dependency Dashboard” issue in the repository listing all detected images, pending updates, and checkboxes to trigger a PR outside the schedule. Step-by-step GitHub App setup for infra-web1 is in stage 5 of Deploy without SSH.

    Where to be careful

    • Databases (postgres, mariadb, redis). Major bumps often require a data migration or dump/restore: don’t merge those PRs blindly — read the release notes first and verify you have a fresh dump (Database backup — dump).
    • Private images. Without a dedicated token, the Renovate GitHub App can’t read digests from a private GHCR package (Build in CI, not on the server): either make the package public or configure hostRules.

    If it doesn’t work

    After installing Renovate, the Dependency Dashboard is empty and no images from compose files show up

    Cause
    The GitHub App has no access to infra-web1, or the compose file doesn’t match the filenames the docker-compose manager looks for (docker-compose.yaml, docker-compose.yml, compose.yaml, compose.yml by default).
    Fix
    On GitHub, open Settings, Applications, Renovate, Configure and confirm infra-web1 is listed. Rename non-standard files to docker-compose.yaml or add a path pattern in renovate.json.

    A new image version is out in the registry, yet no pull request appeared

    Cause
    The schedule window hasn’t started, the update is batched in the shared digests PR, or the concurrent PR limit was reached (10 in config:recommended).
    Fix
    Open the “Dependency Dashboard” issue in the repository: it explains why an update is waiting and provides a checkbox to open the PR immediately.

    Renovate updates public images but skips your own private GHCR image or flags an access error

    Cause
    The Renovate GitHub App has no token to read the private package in ghcr.io.
    Fix
    If the image can be public, switch the package visibility to Public in Package settings. For a private package, configure hostRules with a read:packages token (GitHub Actions to GHCR).

    After merging the first “Pin dependencies” PR, one of the stacks failed to come up

    Cause
    The initial PR pins the current digests in the registry, which may have moved ahead of older images pulled onto the server long ago.
    Fix
    The deploy script rolls back the commit automatically (Deploy without SSH). On a manual setup, run git revert, inspect the failing stack’s logs, and update that stack separately.

    How to check

    The infra-web1 repository has an open “Dependency Dashboard” issue, and its “Detected dependencies” (docker-compose) section lists every docker-compose.yaml from /opt.

    After merging the first PR (“Pin dependencies”), every image in the repository has a @sha256:… digest pinned:

    sudo grep -h 'image:' /opt/*/docker-compose.yaml
    #     image: traefik:v3.7@sha256:...