This is not easy to ask at this time. Installed state-fully scalable clusters are complex when each cluster member needs a unique identification and storage volume.
In Docker Swarm today, you are probably advised to start each member of the cluster as a separate service in your build file (see 31z4 / zookeeper-docker ):
version: '2'
services:
zoo1:
image: 31z4/zookeeper
restart: always
ports:
- 2181:2181
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
zoo2:
image: 31z4/zookeeper
restart: always
ports:
- 2182:2181
environment:
ZOO_MY_ID: 2
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
..
..
For a modern (but still evolving) solution, I recommend checking out Kubernetes:
Statefulsets . , Docker Swarm , "" , .