Skip to content
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

Support COMPOSE_PROJECT_NAME #1524

Merged

Conversation

bkneis
Copy link
Contributor

@bkneis bkneis commented Jan 7, 2025

Fixes #1513

Currently we always set the docker compose project name, using the --project-name (-p) flag in pkg/devcontainer/compose.go, with an auto generated name. This is the highest priority way of setting the project name according to the docs and therefore can never to overridden.

This PR introduces the ability for a user to set the project name via an env var so that the project name be known in advance. Since this is supported by docker-compose I thought we should support as well. See the issue for an example of not knowing the project name.

To test this PR set the env var COMPOSE_PROJECT_NAME=test and run devpod up using a docker compose example to see the naming taking effect.

@bkneis bkneis requested a review from a team January 7, 2025 14:41
Copy link
Member

@pascalbreuninger pascalbreuninger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bkneis bkneis merged commit 9477825 into loft-sh:main Jan 7, 2025
17 of 23 checks passed
@bkneis bkneis deleted the feature/support-docker-compose-project-name branch January 7, 2025 16:02
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.

Export an env var with the docker compose project name / config hash
2 participants