You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since docker-compose service can be scaled, it would be useful to export to each container the replica ordinal index as some environment variable or the contents of some system file. This index can be used, for example, to create replicas own subdirectories if all replicas use the same host path as bind mounts.
The text was updated successfully, but these errors were encountered:
@languitar
First of all, keep in mind that Compose does not guarantee a strictly continuous sequence of ordinal indexes. Continuity can be broken when removing some container instances and re-executing docker-compose up --scale ...
The ordinal index can be retrieved from container's FQDN.
For example, if the container has bash, nslookup, hostname, and head utilities, then try the following command:
Since docker-compose service can be scaled, it would be useful to export to each container the replica ordinal index as some environment variable or the contents of some system file. This index can be used, for example, to create replicas own subdirectories if all replicas use the same host path as bind mounts.
The text was updated successfully, but these errors were encountered: