-1

Unable to connect spring boot service from docker container in WSL2

tried below steps:

  1. tried connection with ipv4, NAT but doesn't help

  2. tried solution from

https://superuser.com/questions/1732399/cannot-communicate-with-windows-localhost-from-wsl2

  1. get the IP from

echo $(host hostname --long | grep -oP '(\s)\d+(.\d+){3}' | tail -1 | awk '{ print $NF }' | tr -d '\r')

curl -I http://<ip_from_abv_cmd>:9003/health_check

//Connection timed out

Please help. TIA

3
  • How are you running the Spring Boot application? what is the configuration you use for the Docke container?
    – Jaime
    Commented Jul 14 at 22:47
  • Spring boot app running from intellij. From WSL, nodejs app is running. Dockerfile: CMD ["node", "/app/runtime/server.js"]
    – Raushan
    Commented Jul 15 at 8:37
  • From WSL, I am not able to ping my laptop IP also
    – Raushan
    Commented Jul 15 at 8:38

0

You must log in to answer this question.