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

docker-compose project name restrictions - can not set project name #378

Closed
paulschuetz opened this issue Oct 5, 2022 · 1 comment · Fixed by #386
Closed

docker-compose project name restrictions - can not set project name #378

paulschuetz opened this issue Oct 5, 2022 · 1 comment · Fixed by #386

Comments

@paulschuetz
Copy link

paulschuetz commented Oct 5, 2022

Setup:

  • id "com.avast.gradle.docker-compose" version "0.16.9"
  • docker version: 20.10.18
  • Docker Compose version v2.10.2

Problem:
It seems like newer versions of docker-compose somewhat restrict the project name (no uppercase characters), see docker/compose#9741. Unfortunately, the project name generated by the gradle-docker-compose-plugin for the following config

dockerCompose {
        isRequiredByIntegrationTest 'docker/docker-compose.yml'
    }

is 1bd882aa0fc45e9fb48ec8510af6c6d8_xxxxxx_integrationTest (notice the uppercase "T")

Therefore when I run the integration tests I get the following error message:
"1bd882aa0fc45e9fb48ec8510af6c6d8_xxxxxx_integrationTest" is not a valid project name.

Therefore, I would suggest this you to not generate project names with uppercase characters as a fix!

Other than that I tried to set the project name manually, like

dockerCompose {
        projectName 'lowercase-only'
        isRequiredByIntegrationTest 'docker/docker-compose.yml'
    }

However this seems to have no effect at all! How can I set the project name correctly? Or why is it not working like that?

@paulschuetz
Copy link
Author

The lowercase only policy was introduced in docker-compose version 2.5.0, see https://docs.docker.com/compose/release-notes/#250.

@paulschuetz paulschuetz reopened this Oct 9, 2022
aykborstelmann added a commit to aykborstelmann/gradle-docker-compose-plugin that referenced this issue Nov 11, 2022
aykborstelmann added a commit to aykborstelmann/gradle-docker-compose-plugin that referenced this issue Nov 11, 2022
@augi augi closed this as completed in #386 Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants