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
After reloading firewall-cmd, please reload the docker daemon:
$ systemctl restart docker
This can be the solution, but other factors may be the cause as well.