Error: Caused by: java.net.UnknownHostException: host.docker.internal: Name or service not known
Reason: as I understand the problem, docker creates random alias for 172.17.0.1 instead of host.docker.internal. If you connect to db via jdbc:mysql://172.17.0.1:3306/DB, it will work as well.enter image description here