# Transport\_address resolved as IP:PORT in docker

**URL:** https://discuss.elastic.co/t/transport-address-resolved-as-ip-port-in-docker/302718
**Category:** Elasticsearch
**Tags:** docker
**Created:** [April 19, 2022, 1:21pm UTC](https://discuss.elastic.co/t/transport-address-resolved-as-ip-port-in-docker/302718 "2022-04-19T13:21:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jan\_Kucera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jan_kucera/32/104543_2.png) [@Jan\_Kucera](https://discuss.elastic.co/u/Jan_Kucera)
#### Post date: [April 19, 2022, 1:21pm UTC](https://discuss.elastic.co/t/transport-address-resolved-as-ip-port-in-docker/302718/1 "2022-04-19T13:21:10Z")

</div>

Hello everyone,

I am struggling with Docker and Elasticsearch. I am trying to setup my instance so it has published adddress in format HOSTNAME:PORT and not IP:PORT for both HTTP and transport. I am posting my docker-compose setting (with ES 8.0.0)

```auto
  elastic-1:
    container_name: elastic-1
    restart: unless-stopped
    environment:
      - INSTANCE_NAME=elastic-1
      - node.name=elastic-1
      - cluster.name=elastic
      - cluster.initial_master_nodes=elastic-1
      - bootstrap.memory_lock=true
      - ES_SETTING_NETWORK_HOST=elastic-1
      - ES_SETTING_TRANSPORT_HOST=elastic-1
      - ES_JAVA_OPTS=-Xms512m -Xmx512m -Des.transport.cname_in_publish_address=true

```

Instance is running well however when I call `_nodes/_all/os` I get following results:

```auto
  "nodes": {
    "xjHfLp5gTo2jSEebxUhOAA": {
      "name": "elastic-1",
      "transport_address": "172.20.100.10:9300",
      "host": "elastic-1",
      "ip": "172.20.100.10",
      "version": "8.0.0",
      "http": {
        "bound_address": [
          "172.20.100.10:9200"
        ],
        "publish_address": "elastic-1/172.20.100.10:9200",
        "max_content_length_in_bytes": 104857600
      }

```

My question is how can I achieve "elastic-1:9300" in `transport_address` and `publish_address`? My issue is that I am trying to use Apache Spark connecting to ES and it fails since it tries to connect to node using IP address and not hostname.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 17, 2022, 1:22pm UTC](https://discuss.elastic.co/t/transport-address-resolved-as-ip-port-in-docker/302718/2 "2022-05-17T13:22:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
