I have configured Renovate Bot in my self-hosted GitLab CE instance using a renovate.json
file. My project contains two different Dockerfiles located at:
project root
/build-1/Dockerfile
/build-2/Dockerfile
/build-1/Dockerfile
, I want to use the latest AlmaLinux 8 version./build-2/Dockerfile
, I want to use the latest AlmaLinux 9 version.However, Renovate Bot is incorrectly attempting to update the AlmaLinux 8 image to version 9.
How can I configure Renovate Bot to ensure that /build-1/Dockerfile
only receives updates within AlmaLinux 8, and /build-2/Dockerfile
only updates within AlmaLinux 9?
My current renovate.json
file:
{
"packageRules": [
{
"packageNames": ["almalinux"],
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"schedule": ["after 6pm"],
"automerge": true
}
]
}
Any guidance would be greatly appreciated.
You can implement a package rule dedicated to one file where you restrict the max version using matchFileNames
and allowedVersions
.
Something like this:
"packageRules": [
{
"packageNames": ["almalinux"],
"matchFileNames": ["/build-1/Dockerfile"],
"allowedVersions": "<9"
}
]
This can be combined with other rules that you already have, you don't need to merge everything in a single rule.