fix: expand tilde in --env-file paths to user home directory by tensorworkerr · Pull Request #13510 · docker/compose

ndeloof

When using --env-file=~/.env, the tilde was not expanded to the user's
home directory. Instead, it was treated as a literal character and
resolved relative to the current working directory, resulting in errors
like "couldn't find env file: /current/dir/~/.env".

This adds an ExpandUser function that expands ~ to the home directory
before converting relative paths to absolute paths.

Fixes docker#13508

Signed-off-by: tensorworker <tensorworker@proton.me>
…on.me>

Signed-off-by: tensorworker <tensorworker@proton.me>

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request

Jan 22, 2026

smallprogram added a commit to smallprogram/openwrt_packages that referenced this pull request

Jan 29, 2026