Reuse of docker swarm containers for batch jobs
Correct me if I am wrong, but that is one of the reasons why docker orchestration tools exists like docker-swarm to be able to deploy multiple docker containers by using one command line.


  Create a service with 5 replica tasks (–replicas)
  
  Use the --replicas flag to set the number of replica tasks for a replicated service. The following command creates a redis service with
  5 replica tasks:

$ docker service create --name redis --replicas=5 redis:3.0.6

4cdgfyky7ozwh3htjfw0d12qv



If for example 1000 identical containers that use a different environment variable have to be deployed, multiple docker service create could be added to a script, instead of copy-paste multiple times in one docker-compose file.