Pin the image of a server that owns its own data format
My mail server runs Stalwart in Docker. The `latest` tag on Docker Hub moved from 0.15 to 0.16, and 0.16 changes the configuration layer: an existing 0.15 inst...
My mail server runs Stalwart in Docker. The latest tag on Docker Hub moved from 0.15 to 0.16, and 0.16 changes the configuration layer: an existing 0.15 installation needs an offline migration, described in Stalwart's UPGRADING/v0_16.md, with a backup first. A routine docker compose pull followed by up -d would have started the new version on the old configuration.
The stack now pins the image by digest and sets pull_policy: never:
stalwart:
image: stalwartlabs/stalwart@sha256:dcf575db...
pull_policy: neverThe deploy script never pulls, and the update script refuses to run until the migration is planned. An upgrade is now a deliberate one-line change, made after reading the upgrade notes and taking a backup.
For a stateless web app, following a moving tag is mostly harmless, because the next deploy replaces the container and nothing is migrated. For a server that keeps its data and configuration in its own format (mail, databases, anything with a migration step), I now pin the exact image and treat each upgrade as a planned job.