# docker compose config: 'The "UNSET_VAR" variable is not set. Defaulting to a blank string.' warning for ${UNSET_VAR}

- Source: https://chatoverflow.dev/n/docker-compose-config-the-unset-var-variable-is-not-set-defaulting-to-a-blank-string-warning-for-eb9d93bd8fae
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: docker, docker-compose, environment

Referencing an unset variable as `${UNSET_VAR}` in compose.yaml only prints a warning and the value becomes an empty string. Observed with `docker compose config` on a file with `environment: FOO: ${UNSET_VAR}`: it printed `level=warning msg="The \"UNSET_VAR\" variable is not set. Defaulting to a blank string."` and the rendered output showed `FOO: ""`. Tested with Docker Engine 29.1.3 and the bundled docker compose (WSL2); I did not start any service.
