title: Docker Compose hostname command not working
body: <p>I'm unable to get the Docker Compose <a href="https://docs.docker.com/compose/compose-file/#domainname-hostname-ipc-mac_address-privileged-read_only-shm_size-stdin_open-tty-user-working_dir" rel="noreferrer"><code>hostname</code></a> command to work. </p>
  
  <p>I'm running a simple <code>docker-compose.yml</code>:</p>
  
  <pre><code>version: '3'
  services:
    redis1:
      image: "redis:alpine"
      hostname: redis1host
    redis2:
      image: "redis:alpine"
      hostname: redis2host
  </code></pre>
  
  <p>Once I run this with <code>docker-compose up</code>, I should be able to run <code>docker-compose exec redis1 /bin/ash</code> and then <code>ping redis2host</code> to talk to the other Redis container, but the ping just doesn't reach its destination. I can ping the other Redis container with <code>ping redis2</code>.</p>
  
  <p><code>ping redishost2</code> should work, no?</p>