How do I handle docker tags with SHA1 hashes at the end? #32611
-
How are you running Renovate?A Mend.io-hosted app If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.No response Please tell us more about your question or problemOne particular docker image has tags that look like this:
I'm not able to figure out how to tell Renovate to process these versions. I have the following in my {
// hotio tags use a format like "release-4.0.4.1491"
// See: https://github.com/renovatebot/renovate/issues/7297
//
// Examples:
// - release-1.40.2.8395-c67dce28e
// - main-v1.52.8
// - release-4.3.3
"matchDatasources": ["docker"],
"matchPackagePrefixes": [
"ghcr.io/hotio/",
"ghcr.io/berriai/"
],
"versionCompatibility": "^(?<compatibility>[^-]+)-v?(?<version>.+)"
}, In this case, when set at version What am I missing? Logs (if relevant)No response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
https://docs.renovatebot.com/modules/versioning/loose/ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"matchDatasources": ["docker"],
"matchPackagePrefixes": ["ghcr.io/hotio/", "ghcr.io/berriai/"],
"versioning": "loose"
}
]
} |
Beta Was this translation helpful? Give feedback.
-
Hi there, Get your discussion fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible. Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this. Discussions without reproductions are less likely to be converted to Issues. Please follow these steps:
If you need help with running renovate on your minimal reproduction repository, please refer to our Running Renovate guide. The Renovate team |
Beta Was this translation helpful? Give feedback.
-
Hi there, We appreciate the effort you put into creating a reproduction. But your reproduction is not minimal yet, or is missing fields we ask for in our template. Please re-read the steps and documentation given in the previous message, and try again to create a minimal reproduction. Thanks, the Renovate team |
Beta Was this translation helpful? Give feedback.
-
After a lot of struggle, I managed to find out the answer on my own. The key is to make the The below package rule works well for my use case. {
// hotio tags use a format like "release-4.0.4.1491"
// See: https://github.com/renovatebot/renovate/issues/7297
//
// Examples:
// - main-v1.52.8
// - release-4.3.3
// - release-1.40.2.8395-c67dce28e
"matchDatasources": ["docker"],
"matchPackageNames": [
"/^ghcr.io/hotio//",
"/^ghcr.io/berriai//",
],
"versionCompatibility": "(?<compatibility>[^-]+)-v?(?<version>\\d+\\.\\d+\\.\\d+(?:\\.[\\w\\d.-]+)?)",
"versioning": "loose",
}, |
Beta Was this translation helpful? Give feedback.
After a lot of struggle, I managed to find out the answer on my own. The key is to make the
versionCompatibility
regex more comprehensive. Many tags for these particular docker images do not follow semver structure (e.g. large numbers with no dots in them), so those were being treated as upgrades instead, which was wrong.The below package rule works well for my use case.