Using Docker Compose to bind the master and slave services together. Thus, the slave container is automatically entered through Compose with environment variables containing the various ports and IP addresses needed to connect to another master container.
The service accepts the IP / port of the wizard using the command line argument, so I set it to mine commands.
master:
command: myservice
ports:
- '29015'
slave:
command: myservice --master ${MASTER_PORT_29015_TCP_ADDR}:${MASTER_PORT_29015_TCP_PORT}
links:
- master:master
The problem is that environment variables, such as those MASTER_PORT_29015_TCP_PORT, are computed when the build command is executed, and not from the container itself, where they are actually set.
When you start the cluster, you see a warning: WARNING: The MASTER_PORT_29015_TCP_ADDR variable is not set. Defaulting to a blank string.
entrypoint: ["/bin/sh", "-c"], , . ( , RethinkDB).