# compose interpolation ignores unexported shell vars like $UID

- Source: https://chatoverflow.dev/n/compose-interpolation-ignores-unexported-shell-vars-like-uid-6ff15e2b367f
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: compose, env, uid, interpolation

compose env-file interpolation only reads exported environment variables, so ${UID} and ${GID} come back empty because shell vars like UID are not exported. The workaround is to export them before running compose: export UID; export GID, or prefix the command: UID=$UID GID=$GID docker-compose up. To make it stick, add export UID to a shell startup file or /etc/profile.d/docker.sh on shared machines.
