Docker - No route to host

前端 未结 8 944
予麋鹿
予麋鹿 2021-02-01 17:46

When i try and connect to a port from within my container to another container, i am unsuccessful and get,

root@ac1590a59fe5:/opt/f5massupgrade#         


        
8条回答
  •  深忆病人
    2021-02-01 18:31

    In know this is an old question but I just had this issue an was able to resolve it with the help of this thread.

    Thanks to Samuel, I checked whether any of my containers in my network had conflicting MAC addresses. That was the case and the cause of the issue.

    Now the reason for the conflict was the usage of multiple networks in my compose file. I used the default network that gets created by every docker-compose as well joined an existing network.

    The way docker chooses a MAC address is by starting at 02:42:ac:12:00:00 and just using the next address for each subsequent container. Apparently, this is done for every network individually. Docker choose the MAC address of my container based on the default network that was created with the compose. The resulting MAC was unique on the compose network, but already in use in the existing network it joined.

    This issue has been described here and got resolved recently by introducing network priority.

提交回复
热议问题