79549224

Date: 2025-04-01 21:21:54
Score: 1
Natty:
Report link

Ok, finally I have found a solution.

Actually, I can choose any ip address to end up my tunnel. So, instead of 127.0.0.2 I need to end up this tunnel on address 172.17.0.1 - this address is output of this command on host:

ip addr show docker0

After that I can simply connect from my PHP-container:

 $db = new PDO("mysql:host=172.17.0.1;port=13306", "user", "pass");
Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: dima.rus