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