1

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?

Vin
  • 309
  • 1
  • 11
  • Does this answer your question? [docker-compose v3 prepend folder name to network name](https://stackoverflow.com/questions/42570539/docker-compose-v3-prepend-folder-name-to-network-name) – Zucchini Apr 19 '21 at 20:32
  • @Zucchini Unfortunately, no. I know I can use the `-p` flag to specify the project name. What I'm trying to understand is: why the prefix was previously different from my directory name and now, all of a sudden, it changed to being the same. – Vin Apr 19 '21 at 21:23

0 Answers0