# Aerospike docker connection refused using docker servicename

**URL:** <https://discuss.aerospike.com/t/aerospike-docker-connection-refused-using-docker-servicename/6858>\
**Category:** General Discussion\
**Created:** [November 27, 2019, 7:23pm UTC](https://discuss.aerospike.com/t/aerospike-docker-connection-refused-using-docker-servicename/6858 "2019-11-27T19:23:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhinav054](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/abhinav054/32/1322_2.png) [@abhinav054](https://discuss.aerospike.com/u/abhinav054)\
**Post date:** [November 27, 2019, 7:23pm UTC](https://discuss.aerospike.com/t/aerospike-docker-connection-refused-using-docker-servicename/6858/1 "2019-11-27T19:23:35Z")

</div>

I am trying to use aerospike docker container , with python application also running same docker network. Below is the docker compose file.

```auto
aerospike:
    image: aerospike/aerospike-server
    volumes: 
      - "./aerospikeconfig:/opt/aerospike/etc"
    environment: 
      config-file: /opt/aerospike/etc/aerospike.conf

  rtbconsumer:
    image: abhinav054/rtb_consumer:trending
    depends_on: 
      - aerospike
      - kafka
    environment: 
      CONSUMER_ID: "rtb_aerospike_2"
      HOST: "kafka:9092"
      TOPIC: "rtb-logs"
      AEROSPIKE_HOST: "aerospike:3000"

```

So in my script I am connecting aerospike using the below given config

```auto
config = { 
      'hosts':[('aerospike', 3000)],
      'policies': {
        'timeout': 1000 # milliseconds
      }
    }

```

The error I am getting is **exception.ConnectionError: (-10, ‘Failed to connect’, ‘src/main/aerospike/as\_cluster.c’, 254, False)**

Can someone please help me figure out the problem.

---

<div class="post-metadata">

**Author:** ![Mich\_Talebzadeh](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/mich_talebzadeh/32/1141_2.png) [@Mich\_Talebzadeh](https://discuss.aerospike.com/u/Mich_Talebzadeh)\
**Post date:** [November 30, 2019, 1:49pm UTC](https://discuss.aerospike.com/t/aerospike-docker-connection-refused-using-docker-servicename/6858/2 "2019-11-30T13:49:52Z")

</div>

Hi,

What command are you using to create Aerospike container. I assume this is community version. How are you mapping that port 3000 to host please. Can you please do

```auto
docker inspect name

```

where ‘name’ is the name you used to create the container.

HTH
