This issue applies to:
RHEL/CentOS 7.x and later
firewalld will block intercontainer networking on the same docker host. To allow communication between the docker containers, run the following commands:
$ firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 4 -i docker0 -j ACCEPT
$ firewall-cmd --reload
This can be the solution, but other factors may be the cause as well.