The image schema, the wording in .env.example and the renovate rules are conventions no file states on its own. Write them down where coding agents and contributors look first.
3.4 KiB
AGENTS.md
Compose files for running OpenCloud. Each module is one compose file, modules are combined through COMPOSE_FILE (see README.md).
Adding a Docker image
Every new image follows one schema. Renovate detects it from the schema alone, there is no annotation and no file list to maintain.
-
Write the image line with an image and a tag variable, both with a default:
image: ${<NAME>_DOCKER_IMAGE:-<registry/image>}:${<NAME>_DOCKER_TAG:-<version>}<version>is an exact released version, usually the onelatestpoints to today. An image without version tags is pinned by the digest of its multi-arch index (docker buildx imagetools inspect <image>:latest):image: ${<NAME>_DOCKER_IMAGE:-<registry/image>}:${<NAME>_DOCKER_TAG:-latest@sha256:<digest>} -
Document both variables in
.env.example, uncommented and empty, in this wording:# Docker image to use for the <name> container. Defaults to "<registry/image>". <NAME>_DOCKER_IMAGE= # Docker tag to pull for the <name> container. # Defaults to the pinned version. Use git pull to update. <NAME>_DOCKER_TAG=The version number lives only in the compose file.
.env.exampleandREADME.mdsay "pinned version", because renovate bumps the compose file and a copied number goes stale..env.exampleis the reference for variables. The table inREADME.mdis a selection: add a row there only when asked. -
Check compose. Done when the pinned image is printed and there is no warning:
docker compose --env-file .env.example -f docker-compose.yml -f <module>.yml config | grep image: -
Check renovate. Done when the output shows the image with its
depNameandcurrentValue:docker run --rm -v "$PWD:/usr/src/app" -e LOG_LEVEL=debug renovate/renovate --platform=local 2>&1 \ | grep -A3 '"depName": "<registry/image>"'Renovate finds files through
git ls-files:git adda new compose file before the run. To see an update proposal, pin an older version for the run and widen the grep to-A12.
How renovate treats images
-
Detection: one pattern in
renovate.json(customManagers) matches the schema above in every yaml file and reads name, tag and digest from theimage:line. Images written as a fixed string (traefik:v3.7.18) are older and handled by renovate'sdocker-composemanager. -
Automerge: patch updates are merged automatically for every image. An image that needs a manual merge gets its own rule by package name, placed after the automerge rule:
{ "matchPackageNames": ["<registry/image>"], "automerge": false } -
Version limits: an image that must stay on one major gets an
allowedVersionsrule by package name, likepostgres. -
Tag suffix variants: a variant published as a tag suffix is a third variable appended to the tag, like
TIKA_DOCKER_VARIANTinsearch/tika.yml. A variant published as a separate image needs nothing, the image variable selects it. -
Stable branches:
renovate.jsononmainalso governsstable-*. Check a pattern change against theimage:lines on those branches.
Removing or renaming a variable
Compose ignores a variable it no longer reads, so an old .env fails silently. Make it fail loudly: add the old name to x-removed-variables in the module's compose file, like TIKA_IMAGE in search/tika.yml. Compose then aborts with the message when the old variable is still set.