mioara
mioara
KPCKevin Powell - Community
Created by mioara on 2/25/2025 in #os-and-tools
issue with docker not connecting to localhost
yes It's already documented in a google docs. thanks
34 replies
KPCKevin Powell - Community
Created by mioara on 2/25/2025 in #os-and-tools
issue with docker not connecting to localhost
it was a very tricky error but your suggestions helped
34 replies
KPCKevin Powell - Community
Created by mioara on 2/25/2025 in #os-and-tools
issue with docker not connecting to localhost
thank you for your help. What I did to fix this error on mac: modified the docker daemon.json file to add a custom dns server, modified the etc/hosts file so that 127.0.0.1 points to my custom domain and make sure the postgres server is running inside docker container.
34 replies
KPCKevin Powell - Community
Created by mioara on 2/25/2025 in #os-and-tools
issue with docker not connecting to localhost
or the host
34 replies
KPCKevin Powell - Community
Created by mioara on 2/25/2025 in #os-and-tools
issue with docker not connecting to localhost
it's this IP the one I need to set in hosts file?
34 replies
KPCKevin Powell - Community
Created by mioara on 2/25/2025 in #os-and-tools
issue with docker not connecting to localhost
next I ran this docker network inspect bridge | grep Gateway which returned this "Gateway": "172.17.0.1"
34 replies
KPCKevin Powell - Community
Created by mioara on 2/25/2025 in #os-and-tools
issue with docker not connecting to localhost
ok I will tell you what commands I run on mac and the output. please forgive me, my first time working with docker and backend, I am a frontend dev, but being part of a team project I encountered this issue as the app runs on docker. so on mac first I ran docker info | grep "OSType" which logged OSType: linux. so docker runs inside a VM, right?
34 replies
KPCKevin Powell - Community
Created by mioara on 2/25/2025 in #os-and-tools
issue with docker not connecting to localhost
thanks for the suggestions, I did this but still the error persists..
34 replies
KPCKevin Powell - Community
Created by mioara on 2/25/2025 in #os-and-tools
issue with docker not connecting to localhost
so in hosts file I need to have network ip db.localtest.me ?
34 replies
KPCKevin Powell - Community
Created by mioara on 2/25/2025 in #os-and-tools
issue with docker not connecting to localhost
thanks for the suggestion. what I did: checked docker network to grab the IP, with this command docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' c88a8163f662. I grabbed the network IP and pasted in the hosts file with the database name. when I run psql -h <network IP> -U postgres -d postgres, I get error connection failed. but when I run psql -h host.docker.internal -U postgres -d postgres, I can access the databse but still the localhost server won't run. page is loading until the error appears again. so it connects to host.docker.internal but not to the docker network IP?
34 replies