title: How does docker-compose create aliases for link ips
body: <p>when running docker-compose, all containers have network aliases to the ip of the other containers running in the network.
  How are these aliases created ?</p>
  
  <p>I need to recreate an alias in an nginx container within a Kubernetes cluster, because nginx conf doesn't allow environment variables and I reverse proxy requests to another container from there.
  I would normally edit the /etc/hosts file, but since docker-compose doesn't, I'm wondering how is the alias created and if I could do it the same way within my kubernetes cluster.</p>