Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renovate doesn't update docker-compose with yaml anchors anymore #34369

Open
rarkins opened this issue Feb 21, 2025 · 1 comment
Open

Renovate doesn't update docker-compose with yaml anchors anymore #34369

rarkins opened this issue Feb 21, 2025 · 1 comment
Labels
manager:docker-compose Docker Compose files priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others

Comments

@rarkins
Copy link
Collaborator

rarkins commented Feb 21, 2025

Discussed in #32918

Originally posted by mueller-ma December 5, 2024

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 problem

In the past Renovate had no problems when a Docker compose file had yaml anchors. Now it doesn't extract the image anymore:

docker compose can use and parse this docker-compose file. You can see that docker includes the image in both services:

$ docker compose -f docker-compose.yml config
name: tmp
services:
  service-a:
    environment:
      SERVICE: a
    image: debian:11
    networks:
      default: null
  service-b:
    environment:
      SERVICE: b
    image: debian:11
    networks:
      default: null
networks:
  default:
    name: tmp_default
x-shared_setting:
  image: debian:11

Logs (if relevant)

Logs

DEBUG: packageFiles with updates
{
  "baseBranch": "main"
  "config": {
    "docker-compose": [
      {
        "deps": [],
        "packageFile": "docker-compose.yml"
      }
    ]
  }
}

Reproduction: renovate-reproductions/32918

@rarkins rarkins added manager:docker-compose Docker Compose files priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Feb 21, 2025
@vic1707
Copy link

vic1707 commented Feb 21, 2025

As added context extracted from the discussion

it appears that adding

%YAML 1.1
---

At the top of the file help get back some anchors capabilities.

With the fix, merging maps seems to be parsed correctly
working example:

%YAML 1.1
---
x-GICKUP: &GICKUP
    image: docker.io/buddyspencer/gickup:0.10.36

services:
    gickup:
        <<: *GICKUP

while using a scalar alias for a single value instead of merging a mapping doesn't work.

%YAML 1.1
---
x-GICKUP: &GICKUP docker.io/buddyspencer/gickup:0.10.36

services:
    gickup:
        image: *GICKUP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:docker-compose Docker Compose files priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others
Projects
None yet
Development

No branches or pull requests

2 participants