Skip to content

Fix: Honor COMPOSE_PROFILE environment variable #1042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

varkrish
Copy link

@varkrish varkrish commented Jul 1, 2025

This commit addresses an issue where the devcontainer exec command would always override the COMPOSE_PROFILE environment variable by defaulting to --profile * when reading the Docker Compose configuration.

The readDockerComposeConfig function in src/spec-node/dockerCompose.ts has been updated to check for the presence of the COMPOSE_PROFILE environment variable. If COMPOSE_PROFILE is set, the --profile * argument will not be added, allowing users to specify their desired profiles through the environment variable.

Additionally, new tests have been added to src/test/dockerComposeUtils.test.ts to verify this behavior.

This commit addresses an issue where the `devcontainer exec` command
would always override the `COMPOSE_PROFILE` environment variable by
defaulting to `--profile *` when reading the Docker Compose configuration.

The `readDockerComposeConfig` function in `src/spec-node/dockerCompose.ts`
has been updated to check for the presence of the `COMPOSE_PROFILE`
environment variable. If `COMPOSE_PROFILE` is set, the `--profile *`
argument will not be added, allowing users to specify their desired
profiles through the environment variable.

Additionally, new tests have been added to `src/test/dockerComposeUtils.test.ts`
to verify this behavior.
@varkrish varkrish requested a review from a team as a code owner July 1, 2025 02:13
@varkrish
Copy link
Author

varkrish commented Jul 1, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant