How do I run the same docker-compose.yml several times on same docker daemon with different names?

So, I focused too much on using directives to alter container names manually. The solution was much easier.

docker-compose -p anything run code mvn clean test

docker-compose -p anything_else run code mvn clean test

So, this is the project name solution. Docker compose will use the value given with the option -p as a prefix when creating container names. That means no collision.

Very handy!

For more reading: documentation around project-name option

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)