If some variable substitution can be done within the service create and service update commands, it would be ideal to build the hostname for a container from such variable substitutions. For instance, if the service name is represented as %s and the task ID is represented as %i, a hostname could be build as %s-%i.
Example: Service name is smtp, and there are three tasks (1,2,3). The hostname could then be set as smtp-1, smtp-2, smtp-3 depending on the task ID.
If some variable substitution can be done within the service create and service update commands, it would be ideal to build the hostname for a container from such variable substitutions. For instance, if the service name is represented as %s and the task ID is represented as %i, a hostname could be build as %s-%i.
Example: Service name is smtp, and there are three tasks (1,2,3). The hostname could then be set as smtp-1, smtp-2, smtp-3 depending on the task ID.