Recently I come across a docker-compose file with the below content:
version: '3'
services:
serviceA:
image: someService
hostname: local_serviceA
I know when calling different services amount the same network, we can refer to the service name. For example, we can use http://serviceA
to call serviceA.
But what is the use of the hostname field. Can other containers call service A using local_serviceA
.
I have read this post but don't really understand. Can anyone help? Thanks in advance.