title: Amazon AWS ECS Docker Port not binding correctly
body: <p>I am using the ECS optimized ECS image and deploying using ECS.</p>
  
  <p>So if i bash into the container and <code>curl localhost</code> i get the expected output (expected to be on port 80), this works fine.</p>
  
  <p>Then if i run <code>docker ps</code>
  I get the following output</p>
  
  <pre><code>CONTAINER ID   IMAGE                              COMMAND             CREATED             STATUS              PORTS                        NAMES
  1234           orgname/imagename:release-v0.3.1   "npm start"         53 minutes ago      Up 53 minutes       0.0.0.0:80-&gt;80/tcp           ecs-myname-1234`
  </code></pre>
  
  <p>Which would suggest port <code>80</code> is being mapped as expected. (I also see Amazon ECS Agent but have posted that above as not important)</p>
  
  <p>Then i can run <code>netstat -tulpn | grep :80</code> and i get the following output </p>
  
  <pre><code>(No info could be read for "-p": geteuid()=500 but you should be root.)
  tcp        0      0 :::80                       :::*                        LISTEN      -  
  </code></pre>
  
  <p>Then as root i run <code>sudo netstat -tulpn | grep :80</code> and i get the following output</p>
  
  <pre><code>tcp        0      0 :::80                       :::*                        LISTEN      21299/docker-proxy  
  </code></pre>
  
  <p>This makes me think it's only listening on the IPv6 interface? I as the host record for localhost is 127.0.0.1 that is why when i run <code>curl localhost</code> or <code>curl 127.0.0.1</code> on the host i get <code>curl: (56) Recv failure: Connection reset by peer</code></p>
  
  <p>I have also checked the security groups and networks ACLS (not that they should have an effect on localhost)...</p>
  
  <p>Any thoughts would be much appreciated!</p>
  
  <p>Edit:
  For good measure (some people suggest netstat only shows ipv6 and not ipv4 when ipv6 is available. I have also ran this command <code>lsof -OnP | grep LISTEN</code> gives the following output </p>
  
  <pre><code>sshd       2360     root    3u     IPv4              10256       0t0        TCP *:22 (LISTEN)
  sshd       2360     root    4u     IPv6              10258       0t0        TCP *:22 (LISTEN)
  sendmail   2409     root    4u     IPv4              10356       0t0        TCP 127.0.0.1:25 (LISTEN)
  exe        2909     root    4u     IPv4              13802       0t0        TCP 127.0.0.1:51678 (LISTEN)
  exe       21299     root    4u     IPv6              68069       0t0        TCP *:80 (LISTEN)
  exe       26395     root    4u     IPv6              89357       0t0        TCP *:8080 (LISTEN)
  </code></pre>