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

Add a configuration property to set the Docker Compose project name #42483

Closed
treegem opened this issue Sep 30, 2024 · 4 comments
Closed

Add a configuration property to set the Docker Compose project name #42483

treegem opened this issue Sep 30, 2024 · 4 comments
Labels
status: superseded An issue that has been superseded by another

Comments

@treegem
Copy link

treegem commented Sep 30, 2024

Description:
Requesting support for an option to create a random project name in Docker Compose within the spring-boot-docker-compose project. This feature would enable running gradle test with multiple forks simultaneously.

Current Behavior:
The current configuration chooses automatically the default, which is the folder containing the docker-compose.yml, as project name.

Proposed Enhancement:
Introduce a new property spring.docker.compose.random-project : Boolean to allow random Docker Compose project names.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 30, 2024
@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Sep 30, 2024
@mhalbritter mhalbritter added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels Oct 2, 2024
@mhalbritter mhalbritter added this to the 3.x milestone Oct 2, 2024
@mhalbritter mhalbritter changed the title Add option for random project names in Docker Compose Add a configuration property to set the Docker Compose project name Oct 2, 2024
@mhalbritter
Copy link
Contributor

We talked about this and decided to add a property to set the Docker Compose project name. This property would get passed to docker compose via the --project-name argument.

With the new property in place, you could use the RandomValuePropertySource to use a random project name.

@mhalbritter
Copy link
Contributor

mhalbritter commented Oct 2, 2024

Side note: I tried to workaround by specifying spring.docker.compose.start.arguments=--project-name=${random.uuid} (using this new feature) but this doesn't work as docker compose wants the --project-name before the up subcommand. We currently only allow the arguments after start and stop to be specified. I think we should also allow the arguments before the subcommands to be specified, with the property spring.docker.compose.arguments maybe? I've opened #42500 for that.

@mhalbritter
Copy link
Contributor

Closing this in favor of #42500, which is the more general solution.

@mhalbritter mhalbritter closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
@mhalbritter mhalbritter added status: declined A suggestion or change that we don't feel we should currently apply and removed type: enhancement A general enhancement labels Oct 7, 2024
@mhalbritter mhalbritter removed this from the 3.x milestone Oct 7, 2024
@mhalbritter mhalbritter added status: superseded An issue that has been superseded by another and removed status: declined A suggestion or change that we don't feel we should currently apply labels Oct 7, 2024
@mhalbritter
Copy link
Contributor

With #42571 merged, you can now set

spring.docker.compose.arguments=--project-name=${random.uuid}

to get a random project name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

4 participants