Scaling up docker containers with hostname attributes

I have a sample yml file

image: ubuntu
hostname: test
- /var/run/docker.sock:/docker.sock

I can not able to scale up this since second instance of a service gets the same hostname. Is there any way we can get rid of this problem ? I know removing hostnameattribute will solve this problem but I want to scale up containers with hostnames as test_1, test_2 etc

Is it possible today ?