docker container hostname sequential number
问题 Is there any option to have the hostname / containername to have some seq numbers in case of replicas/scale in docker swarm? version: '3' services: serA: image: someimage1 hostname: serA serB: image: someimage2 tty: true hostname: serB{{.Node.index}} deploy: replicas: 2 For ex: I would like to have the hostnames as serB1 and serB2 回答1: AFAIK this is not supported and won't be supported as the Docker team thinks it's a bad idea: After some thought, I don't think this is a good idea. We might