0031. Published release image by default; building is opt-in¶
Status: Accepted
Context¶
Releases are published as images (0008), and .env.example turned them on with HORDE_IMAGE, but docker-compose.yml still carried the build section. Two things went wrong for people who simply followed the install guide:
- Compose tries to pull an image that has a
build:section and, when the pull fails, builds it instead, so a registry or network hiccup turned into a long build on a NAS (or an apt error) instead of a clear pull error. git clonegivesmain, usually ahead of the newest release, while the image is that release.update.shcompared the release with the checkout, saw a downgrade and refused, so the first Update now of a new install failed.
Decision¶
- The published image is the default.
docker-compose.ymlnamesghcr.io/jm-connell/horde:latestand has no build section. Building from the checkout is an overlay,docker-compose.build.yml, turned on withCOMPOSE_FILE=docker-compose.yml:docker-compose.build.yml; it always names the imagehorde:latestso a local build never takes the published name. update.shpulls the image of exactly the release it checks out,sha-<shortsha>(every release image carries that tag), checks the commit baked into it, and names it as compose starts it. A missing image (a just-pushed tag whose image is still building) or a mismatch stops the update and puts the checkout back. A pinnedHORDE_IMAGEstops it too, since the update would move it.- The downgrade guard compares the release with what runs, the commit baked into the running image, not the checkout. With the published image the checkout's code never runs.
- The
mainchannel builds. Only releases have images, soupdate.shadds theCOMPOSE_FILEline to.envthe first time it updates a published install onmain. - Installs from before keep building until their checkout reaches a release with the new compose file, then pull: they need to change nothing.
Consequences¶
- A new install runs releases only, without setting anything, and a failed pull fails loudly.
- The checkout and the running image always match after an update, and rollback restores both.
HORDE_IMAGEremains for forks; pinning a version is for running Compose by hand, not withupdate.sh.- Building from source, and following
main, are one documented.envline away.