My situation. Trying to run a docker-compose structure several times on the same box. This is my docker-compose.yml:
version: '3'
services:
code:
image: organization:java-maven
links:
- mysql:mysql
volumes:
- "${PWD}:/home/ubuntu/src"
mysql:
image: organization:mysql
Running this twice with docker-compose run code mvn clean test
creates two containers of code
and one container of mysql
.
Now, I want one code
to be linked to one mysql
, and another code
linked to another mysql
.
How do I accomplish this? This is supposed to run on jenkins slaves and the maven executions cannot share mysql.
I've miserably failed trying with the "-e KEY=VALUE" option for docker-compose run
together with container_name
in the docker compose file.
Not sure how to approach this, please help, thank you.