No error for --env-file if the ./env file does not exist
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Description
This would be really nice QoL improvement for devcontainers. Many devs will have personal .env files with API keys for services, but it's annoying to have to make an empty .env file just so that the docker CLI doesn't error at you. You can do a workaround by using "initialize command" "source .env". I believe this behavior is different than docker compose which lets you provide a path with no file actual file necessary.
I believe the fix would be straightforward just having a different default behavior for the parser which powers this features. If you would like I can make a PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Docker CLI's --env-file entry point and locate the parser mentioned in the issue. Compare its behavior with Docker Compose, then verify that a missing env-file path no longer produces an error while existing-file behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100