Closed crwenner closed 8 months ago
To provide some extra detail:
It seems to be the merging of array / dictionary labels that is the issue. When I altered the overrides to be in the same format as the initial labels field it did not exhibit the error. It also affects 2.24.1.
This regression is covered by https://github.com/compose-spec/compose-go/pull/548
I just wanted to mention our use case causing issues since the upgarde. We have a Makefile
based setup, where we combine multiple compose yaml files to get the final services for development vs production, e.g. something like docker compose -f docker-compose.root.yaml -f docker-compose.database.yaml -f docker-compose.proxy.yaml -f docker-compose.[SOMEENV].override.yaml
To have a default proxy route for our container we use a labels syntax like
services:
web:
labels:
- "traefik.http.routers.${PROJECT_NAME}-http.rule=HostRegexp(`${PROJECT_NAME}.{ip:.*}.traefik.me`)"
This is useful for first time setup and in case someone else breaks the project config.
Other override files then use different labels like
traefik.http.routers.api-https-admin-api.middlewares: basic-auth@file,gzip@file
The main reason for this mixing of syntax of labels is because compose cannot interpolate key's in yaml files, mentioned here.
Description
There appears to be an issue with overriding labels with the new compose version. I am getting the following error:
This is happening in our linux environment, and does not happen when we revert to the previous version 2.23.3.
Steps To Reproduce
Simplified docker-compose.yml file:
Simplified docker-compose.override.yml file:
Running the following command:
Produces this error while running v2.24.2 compose:
cannot override services.app.labels
Compose Version
Docker Environment
Anything else?
No response