Hi, docker newbie here trying to evaluate how suitable docker is for our use case. I’ve been reading over documentation and it’s still unclear to me whether I can use docker to deploy an application with the properties I would like. In particular, I would like to use docker to launch a network with the following properties:
The network is a docker swarm consisting of
nprocesses each running on their own worker node (eventually will be running in AWS)
ncan be determined when the network is launched (ideally via command line)
Each worker, when it is receiving its task to run, is assigned a unique integer ID from
n, and is aware of its ID. Specifically, we will be generating a folder with configuration files for each worker ID and we should be able to determine which configuration folder to copy to a particular instance from its ID.
If a worker dies, it is replaced by another worker with the same ID and the same configuration folder
Mostly I am concerned with whether I can achieve the last two bullet points with a convenient workflow (I know I can get the first two easily in the case where all my workers are the same). I realize I can get this by creating
n different images each with an environment variable specifying the ID and making each worker its own service, but that requires a docker-compose that scales in size with
n and I’d like to do this with a single image and some sort of arguments if at all possible.