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
Description
Given a service with the following labels:
docker compose config --variables --format jsonshowsPIHOLE_DOMAINasRequired=falsewhen it is requiredSteps To Reproduce
With the above config, run:
Output:
{ "PIHOLE_DOMAIN": { "Name": "PIHOLE_DOMAIN", "DefaultValue": "", "PresenceValue": "", "Required": false } }Also run:
Output:
Compose Version
Docker Environment
Anything else?
No response