Closed ShantMahserejian closed 2 years ago
@ShantMahserejian I could not repeat your error. Did you try to do "docker system prune -a" before running the docker-compose?
I resolved the issue by assigning unique network names for the default networks created by docker-compose. I did this by 1) using version: 3.5
, and 2) by adding the following to the end of each docker-compose yaml file:
networks:
default:
name: buildingcontroltest_network_{UNIQUE_NAME}
This way, each default network that is created doesn't interfere with other default networks when running in parallel.
I keep having an issue when attempting to use docker-compose "up" in parallel. I have included the docker-compose yaml files corresponding to a test that I did attached to this issue (re-saved as .txt files so that GitHub will allow the upload). When I run docker-compose "build" and "up" on the two files in two separate terminal windows, I'mi able to build the docker containers successfully. However, when I attempt to run them in parallel using the Python multiprocessing package, I keep getting an error that a docker network with the same name exists. Below is the output to screen I get when running them in parallel. Please note that I made an attempt to resolve this by having the second run sleep for 3 seconds before running the build and up commands, but the output to screen includes what we see happening for both docker-compose commands at the same time otherwise.
As the attached docker-compose files will show, I even tried to create unique names for each image/container by using my unique simulation names, but the network that keeps being created is called "buildingcontroltest_default" for all cases.
I've also included what a list of the docker images, containers, and networks look like below after the ERROR messages. Please note that I did my best to remove any images, containers, and networks manually, as well as run docker-compose "down" with the options "--remove-orphans" and "--rmi local" to avoid any other issues.
As you can see, the build command works fine. It's the up command that encounters the issue. As a result the docker images and networks are created, but not the containers.
docker-compose_my_testE_1.txt docker-compose_my_testE_2.txt