title: Docker for Mac: Hostname setup for container
body: <p>Using Docker for Mac (v1.12.1) I'm running some containers via Compose. I'm using a simple docker-compose.yml like this:</p>
  
  <pre><code>version: '2'
  services:
    website:
      build: .
      ports:
        - "81:80"
  </code></pre>
  
  <p>From the host, connecting works fine via <a href="http://localhost:81" rel="nofollow">http://localhost:81</a>.</p>
  
  <p>To avoid the port mapping I would like to set up a hostname for the container so I can use something like <a href="http://mycontainer.local" rel="nofollow">http://mycontainer.local</a> to connect from the host. Is it possible to set a hostname (or a static IP) for a container?</p>