Skip to content

[BUG] env variable detected as not required even though it is #13718

Description

@mschoettle

Description

Given a service with the following labels:

services:
  pihole:
    image: pihole/pihole:2026.02.0
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.pihole.rule=Host(`${PIHOLE_DOMAIN:?}`)"
      - "traefik.http.services.pihole.loadbalancer.server.port=80"
      # Always redirect / to /admin/
      - "traefik.http.middlewares.pihole-redirect.redirectregex.regex=^(https://${PIHOLE_DOMAIN})/?$"

docker compose config --variables --format json shows PIHOLE_DOMAIN as Required=false when it is required

Steps To Reproduce

With the above config, run:

docker compose config --variables --format json

Output:

{
    "PIHOLE_DOMAIN": {
        "Name": "PIHOLE_DOMAIN",
        "DefaultValue": "",
        "PresenceValue": "",
        "Required": false
    }
}

Also run:

docker compose config --quiet

Output:

$ docker compose config --quiet
error while interpolating services.pihole.labels.[]: required variable PIHOLE_DOMAIN is missing a value

Compose Version

Docker Compose version v2.40.3

Docker Environment


Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions