devcontainers / devcontainers/spec

Add `dockerComposeArgs` to allow passing `--env-file` to `dockerComposeFile`

Open
#726 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
5.7k
Forks
496
PR merge metrics
No merged PRs in 30d

Description

`docker compose up` accepts a `--env-file` to point to a .env file and set its contents as env vars, which are **available when parsing the docker-compose.yaml**. note that this is **different** from the `env_file` config option in `docker-compose.yaml`, which only sets env vars inside the container.

when providing `dockerComposeFile` in `devcontainer.json` there is currently no way to pass `--env file`.

suggestion (following https://github.com/microsoft/vscode-remote-release/issues/4885#issuecomment-2408558170):

```json
{
"dockerComposeFile": ["a.compose.yaml", "b.compose.yaml"],
"dockerComposeArgs": ["--env-file custom.env"]
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.