I declare my service in docker-compose.yml like this:
wildfly:
image: "myrepo/wildfly:latest"
hostname: wildfly
So, compose adds entry to /etc/hosts:
172.18.0.4 wildfly
Where 172.18.0.4 is generated automatically by docker.
But I need to bind some.host.name to this generated IP in /etc/hosts to have multiple entries in /etc/hosts:
172.18.0.4 wildfly
172.18.0.4 some.host.name
How can I do that?
I tried to use extra_hosts syntax, but in docker-compose.yml I have no idea what IP will be assigned to container.
Have anybody faced the similar problem?