title: docker-compose networking - hostname not resolving
body: <p>I have the following docker-compose file. I am trying to access the service running in the container, from the host.</p>
  
  <p>But the hostname never resolves.</p>
  
  <pre><code>version: '2'
  networks: 
    mynet:
      driver: bridge
  services:
  
  
    grpcserver:
      image: test/image
      volumes:
        - ./:/var/local/git
      ports:
        - 50051:50051
      stdin_open: true
      tty: true
      hostname: grpcserver
      networks: 
        - mynet
      entrypoint: bash ../var/local/git/service/start.sh
  </code></pre>
  
  <p>When I <code>exec</code> to the container I can <code>telnet grpcserver 50051</code> to the running service using the hostname successfully. But from the host, I cannot.</p>
  
  <p><strong>Version</strong></p>
  
  <p>docker-compose version 1.16.1, build 6d1ac21</p>