I have multiple docker stacks that are connected over the same network. If I restart one of the stacks the internal ip addresses of the related stack container seems to change. That results in wrong service name resolutions in other stacks and containers. It seems that the internal docker name service doesn't recognize the network change.
If try to access other containers with ping from a stack container shell by the service name (for example ping my_stack_my_container_name
) I got a successful return from a wrong IP address. When I use the full container name instead (ping my_stack_my_container_name.134.134234234123
) the return comes from the right IP.
Is there any way to trigger a reload of the stack networking/name service?
are you sure it's not reloaded? check if the docker containers (that should connect to reloaded container) are not caching DNS query results. I had same issue in haproxy config and I placed following lines to force haproxy to hold values only for 1s:
(...)