title: How can I redirect/map localhost to something point to something else?
body: <p>In my case, this problem is happening within a Docker container but at least partly it should be a generic linux questions.</p>
  
  <p>I'm fighting with an application that I can't configure in the way it connects to another (local) application. It uses <code>http://localhost:8080</code> by out of the box and this can't be changed. I'm using docker in my setup and both containers are running in separate containers. </p>
  
  <p>For reasons I can't run them in <code>network_mode=host</code> where one could reach the other through <code>localhost</code> so I'm looking for a way to "redirect" localhost within one container to the other. I also don't want to use IP addresses here as they may change.</p>
  
  <p>Is there any way to have any kind of mapping that makes <code>localhost</code> be the alias of a different hostname? In my case <code>http://other-container:8080</code> is what I want and which would work perfectly. I can also totally live with not having a "real" localhost within that container.</p>
  
  <p>So is there any way to do so?</p>