- Plesk for Linux
1. Docker container can not connect to the external services running outside of the container, on the remote server or Docker host. Errors can be different based on the specific service, e.g. for MySQL service it can be
MySQL Connection Error: (2002) No route to host
2. Services itself are up and running.
Firewall rejects inbound connections from Docker container.
Configure firewall on the remote server or Docker host to allow connections on the host's specific port from the docker0 interface.
E.g let's assume that error occurs when Docker container was connecting to MySQL database. First find out the IP address of Docker host:
# ip addr show docker0
Next let's configure firewall to allow connections on the port 3306 from the docker0 interface. Replace 203.0.113.2 with the IP address discovered on the previous step.
# iptables -A INPUT -p tcp -s 203.0.113.2 --dport 3306 -i docker0 -j ACCEPT
The command above should be executed on remote server or local server where Docker is running.
If the service is running on the same server with Docker application and firewall is configured, but the issue still persists, then check this article - Unable to connect Docker container to the service running locally: No route to host .