--index targets a specific replica when a service runs multiple instances via --scale or deploy.replicas. Replicas are numbered from 1, so --index 2 hits the second container. Defaults to the first replica when omitted.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.