title: Connection refused when creating a connection from a process on docker container to another process on the same container
body: <p>fI am using localstack framework and run it on a docker container
  I am able to connect from my host to the dynamo service running on the container (port 4569).
  When trying to connect from a lambda running on this container to dynamo (running on the same container), the connection is refused. the IP I am using is the name of the container. (e.g., telnet localstack 4569 will fail from running it from the lambda)</p>
  <p>Docker ps returns:</p>
  <pre><code>13:06:33  CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                                                                                    NAMES
  13:06:33  b909ac695561        localstack/localstack:0.11.4   &quot;docker-entrypoint.sh&quot;   2 minutes ago       Up 2 minutes        4566-4568/tcp, 4593-4597/tcp, 0.0.0.0:4569-4592-&gt;4569-4592/tcp, 0.0.0.0:8055-&gt;8080/tcp   localstack
  </code></pre>
  <p>docker network inspect localstack-network returns:</p>
  <pre><code>13:06:33  [
  13:06:33      {
  13:06:33          &quot;Name&quot;: &quot;localstack-network&quot;,
  13:06:33          &quot;Id&quot;: &quot;09994610b0d71dfc4fe0147bbc884a749362c3fb42397366591c73e3c10702eb&quot;,
  13:06:33          &quot;Created&quot;: &quot;2020-10-04T10:03:52.586816186Z&quot;,
  13:06:33          &quot;Scope&quot;: &quot;local&quot;,
  13:06:33          &quot;Driver&quot;: &quot;bridge&quot;,
  13:06:33          &quot;EnableIPv6&quot;: false,
  13:06:33          &quot;IPAM&quot;: {
  13:06:33              &quot;Driver&quot;: &quot;default&quot;,
  13:06:33              &quot;Options&quot;: null,
  13:06:33              &quot;Config&quot;: [
  13:06:33                  {
  13:06:33                      &quot;Subnet&quot;: &quot;100.66.0.0/16&quot;,
  13:06:33                      &quot;Gateway&quot;: &quot;100.66.0.1&quot;
  13:06:33                  }
  13:06:33              ]
  13:06:33          },
  13:06:33          &quot;Internal&quot;: false,
  13:06:33          &quot;Attachable&quot;: true,
  13:06:33          &quot;Ingress&quot;: false,
  13:06:33          &quot;ConfigFrom&quot;: {
  13:06:33              &quot;Network&quot;: &quot;&quot;
  13:06:33          },
  13:06:33          &quot;ConfigOnly&quot;: false,
  13:06:33          &quot;Containers&quot;: {
  13:06:33              &quot;b909ac695561200c1ab43c70c9f25cd537622593b7eade03d16af89b70c97d76&quot;: {
  13:06:33                  &quot;Name&quot;: &quot;localstack&quot;,
  13:06:33                  &quot;EndpointID&quot;: &quot;783e7aefbef801d7707d46f664b6adf329dceeee6108d23a36c63d5cb3a3fdae&quot;,
  13:06:33                  &quot;MacAddress&quot;: &quot;02:42:64:42:00:02&quot;,
  13:06:33                  &quot;IPv4Address&quot;: &quot;100.66.0.2/16&quot;,
  13:06:33                  &quot;IPv6Address&quot;: &quot;&quot;
  13:06:33              }
  13:06:33          },
  13:06:33          &quot;Options&quot;: {},
  13:06:33          &quot;Labels&quot;: {
  13:06:33              &quot;com.docker.compose.network&quot;: &quot;localstack-network&quot;,
  13:06:33              &quot;com.docker.compose.project&quot;: &quot;infra&quot;,
  13:06:33              &quot;com.docker.compose.version&quot;: &quot;1.24.1&quot;
  13:06:33          }
  13:06:33      }
  13:06:33  ]
  </code></pre>
  <p>docker-compose.yaml:</p>
  <pre><code>  services:
    localstack:
      image: localstack/localstack:0.11.4
      container_name: localstack
      networks:
        - localstack-network
      ports:
        - &quot;4566-4597:4566-4597&quot;
        - '8080:8080'
      environment:
        - SERVICES=lambda,stepfunctions,dynamodb,s3,sns
        - DEBUG=1
        - DATA_DIR=/tmp/localstack/data
        - PORT_WEB_UI=${PORT_WEB_UI- }
        - LAMBDA_EXECUTOR=docker #${LAMBDA_EXECUTOR- docker-reuse}
        - DOCKER_HOST=unix:///var/run/docker.sock
        - LAMBDA_REMOTE_DOCKER=true
        - LAMBDA_REMOVE_CONTAINERS=true
      volumes:
        - &quot;/tmp${TMPDIR:-/tmp/localstack}:/tmp/localstack&quot;
        - &quot;/var/run/docker.sock:/var/run/docker.sock&quot;
  </code></pre>