最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

docker - Prevent Renovate Bot from updating AlmaLinux 8 to 9 in multiple Dockerfiles - Stack Overflow

programmeradmin4浏览0评论

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  
  • In /build-1/Dockerfile, I want to use the latest AlmaLinux 8 version.
  • In /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.

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  
  • In /build-1/Dockerfile, I want to use the latest AlmaLinux 8 version.
  • In /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.

Share Improve this question edited Feb 18 at 19:11 Gaël J 15.2k5 gold badges22 silver badges44 bronze badges asked Feb 16 at 21:35 JasperJasper 1411 silver badge7 bronze badges 2
  • Just close the MR for alma linux 9 on build-1 and you should receive no more major updates for it – Chris Doyle Commented Feb 18 at 7:26
  • docs.renovatebot/key-concepts/pull-requests/#normal-prs from the docs Renovate PRs normally have some "uniqueness" in their title relating to the version in the upgrade. When you close a "unique" PR, Renovate assumes you don't want to see that PR again in future – Chris Doyle Commented Feb 18 at 7:38
Add a comment  | 

1 Answer 1

Reset to default 1

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.

发布评论

评论列表(0)

  1. 暂无评论