Docker Community Forums

Share and learn in the Docker community.

About docker hostname communication issue


#1

Expected behavior

I want to know how to communicate with hostname. please help me

Actual behavior

We use the open source version of the docker. Below is docker information.

deploy@msa:~$ docker version
Client:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 22:00:43 2016
OS/Arch: linux/amd64

Server:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 22:00:43 2016
OS/Arch: linux/amd64

The communication test between the two containers was successful, but the communication with the hostname failed.

Below is test log

deploy@msa:~ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6f6c543b5f2e infinov/cosmeticsservice:latest "java -Djava.security" About an hour ago Up About an hour 0.0.0.0:9002->9002/tcp sad_roentgen 819426aa599a infinov/eurekaserver:latest "java -Djava.security" About an hour ago Up About an hour 0.0.0.0:8761->8761/tcp modest_swirles deploy@msa:~ docker inspect 6f6c543b5f2e|grep IPAddress
“SecondaryIPAddresses”: null,
“IPAddress”: “172.17.0.3”,
“IPAddress”: “172.17.0.3”,
“IPAddress”: “172.18.0.3”,
deploy@msa:~ docker inspect 819426aa599a|grep IPAddress "SecondaryIPAddresses": null, "IPAddress": "172.17.0.2", "IPAddress": "172.17.0.2", "IPAddress": "172.18.0.2", deploy@msa:~ docker exec -it 6f6c543b5f2e bash
root@cosmeticsservice:/# ping 172.17.0.2
PING 172.17.0.2 (172.17.0.2): 56 data bytes
64 bytes from 172.17.0.2: icmp_seq=0 ttl=64 time=0.129 ms
64 bytes from 172.17.0.2: icmp_seq=1 ttl=64 time=0.088 ms
64 bytes from 172.17.0.2: icmp_seq=2 ttl=64 time=0.090 ms
64 bytes from 172.17.0.2: icmp_seq=3 ttl=64 time=0.089 ms
^C— 172.17.0.2 ping statistics —
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.088/0.099/0.129/0.000 ms
root@cosmeticsservice:/# ping eurekaserver
ping: unknown host
root@cosmeticsservice:/# hostname
cosmeticsservice

Additional Information

we develop msa architecture on ms azure for monolithic service

Steps to reproduce the behavior