title: Docker container does not respond to http request
body: <p>I'm trying to send an http request through axios, from my localhost (node server) to a docker container (which contains a simple server in node too) which belongs to a docker network, and identified by an specific IP.</p>
  <p>I have used postman, xmlhttprequests, and axios but nothing seems to work. I have also tried with get and post requests but any of those get any answer from the container side.</p>
  <p>Do you have any Idea of what am I doing wrong?</p>
  <p>the .sh file that Im running to launch the container is:</p>
  <pre><code>docker build -t connectimg .
  docker network create --subnet=119.18.0.0/16 mynet
  docker run -d --name instance2 -p 4002:4000 --net mynet --ip 119.18.0.2 connectimg
  </code></pre>
  <p>and the docker logs result for the instance post-launch is:</p>
  <pre><code>{
    lo: [
      {
        address: '127.0.0.1',
        netmask: '255.0.0.0',
        family: 'IPv4',
        mac: '00:00:00:00:00:00',
        internal: true,
        cidr: '127.0.0.1/8'
      }
    ],
    eth0: [
      {
        address: '119.18.0.2',
        netmask: '255.255.0.0',
        family: 'IPv4',
        mac: '02:42:77:12:00:02',
        internal: false,
        cidr: '119.18.0.2/16'
      }
    ]
  }
  Example app listening on port 3000
  </code></pre>
  <p>My Docker Instance Node app code is:</p>
  <pre><code>const express = require('express')
  const app = express()
  const port = 3000
  const cors = require('cors')
  var os = require('os');
  
  app.use(cors());
  app.use(express.json());
  
  app.listen(port, () =&gt; {
    console.log(`Example app listening on port ${port}`)
  })
  
  app.get('/listen', (req,res) =&gt; {
      console.log('got it');
  })
  
  
  var networkInterfaces = os.networkInterfaces();
  
  console.log(networkInterfaces);
  </code></pre>
  <p>And my Node server piece of code responsible of sending the get request to the instance is:</p>
  <pre><code>const connect  = (req,res) =&gt; {
      axios.get('http://119.18.0.2:3000/listen').then(resp =&gt; {
      console.log(resp.data);
  });
  }
  </code></pre>
  <p>and the error I keep getting is:</p>
  <pre><code>ETIMEDOUT 119.18.0.2:3000    
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
  </code></pre>