I run a number of services, each having a role, for example: frontend, backend
When the services report statsD and logging data etc they report the hostname as the container ID. It would be great if I could see the docker role at that point.
I would like to change the hostname on the containers to have the role name. I can do this by adding the --hostname parameter to docker service create
Whilst this works, there is now no way to match the servers to container IDs.
Is there a way to have a hostname generated that prefixes or appends the container ID so that I get the best of both worlds?
Since it’s not easy or recommended to try to modify the docker container during its startup script, this would have to be a Docker Swarm feature.