mirror of
https://github.com/apple/container.git
synced 2026-09-24 23:29:51 -05:00
## Type of Change - [x] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Documentation update ## Motivation and Context As reported in [1212](https://github.com/apple/container/issues/1212), environment variables defined in a Dockerfile (ENV) were not being overridden when passed via -e at runtime, resulting in duplicate entries in the container's environment. **Root cause:** `Parser.allEnv()` simply merged image, env-file, and user-provided environment variables without deduplication. Since `getenv()` returns the first match, the image default took precedence over the user override. **Fix:** `allEnv()` now deduplicates by key, with later sources overriding earlier ones ## Testing - [x] Tested locally - [x] Added/updated tests - [ ] Added/updated docs