my.yml:
version: '3'
services:
myservice:
image: myimage
When I run docker-compose -p myprefix -f my.yml up
It creates container named myprefix_myservice_1.
Is it possible to generate name, so it would use prefix (project name) and service name only without suffix?
In this case it should be: myprefix_myservice
Whats the point of _1 suffix anyway? Looks weird and does not seem to do anything important, like incrementing _2 for new container etc? If I run same prefix/service name, it just gonna start existing container anyway. So really don't see any reason to have all containers contain same _1 suffix.
I could use container_name, but then it won't be possible to reuse same compose file for multiple containers.
P.S. I read this question: docker-compose image named: "prefix_%s_1" instead of "%s"
But it does not give any answer about suffix.