- Plesk for Linux
1. Docker container unable to connect to the services running on the same server (on the Docker host, not on another Docker container). 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
used when specifying the path to the service.
localhost/127.0.0.1 are reserved by Docker container as a part of its own virtual environment.
Use the server IP address instead of localhost variable or
E.g. let's assume it's needed to connect WordPress Docker container to MySQL database storing on the same server.
is the server's IP address and 3306 is the port used by MySQL DB server.
Check that the firewall is configured in the way to allow connection to the server from Docker container. Refer to this article to learn more about it - Unable to connect Docker container to external services, outside of the container: no route to host .