In Docker Compose, the default project name (prefix) is the directory name. For some reason, even though my directory name contains a hyphen (e.g. my-project
), my services never had one in their names (e.g. myproject_myservice_1
).
However, on my last build, the names of the services were updated and now they include the hyphen (e.g. my-project_myservice_1
).
I'm not using the -p
option to specify a project name. The build command is simply: docker-compose -f docker-compose.yml up -d --build
. I haven't made any changes to the docker-compose.yml
file nor updated Docker version. Strangely, I have the exact same configuration on another server, and on that one, the service names still don't include the hyphen.
What could have caused this change in the service names? Also, why were they not including the hyphen before?