vagrant
vagrant copied to clipboard
Sanitize Docker-Compose provider project name
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
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