vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Sanitize Docker-Compose provider project name

Open Venthe opened this issue 3 years ago • 2 comments

Docker compose project name does not allow upper case characters. By default, Vagrant uses the current working directory as project name, and as such there can exist upper-case characters.

As an alternative, one can use COMPOSE_PROJECT_NAME environment variable to override Vagrant behaviour.

See:

  • https://docs.docker.com/compose/reference/envvars/#compose_project_name

Venthe avatar Jun 22 '22 07:06 Venthe

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Jun 22 '22 07:06 hashicorp-cla

Please note, I am not a Ruby developer - this is a suggestion how to solve this issue in a way that is transparent for the end-user. As such, I have no knowledge how to proceed with writing the tests for it, though the setup should be simple:

# Pseudocode
# given
env.cwd = "Sample"
#  when
command = compose_execute(env)
# then
assert(command).switch_value("-p").is_equal_to("sample")

Alternatively, we could expand the documentation about the project name env variable

Venthe avatar Jun 22 '22 07:06 Venthe