Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

say your docker compose file maps postgres to 55555 on your laptop then in the sandbox db url host is host.docker.internal and port is 55555

does that make sense?





Thanks. Yes.

Connecting via an open port between containers isn't a problem though. They all see each other by name anyway (e.g. I can run a pg client to `db` and it will JustWork). The problem is when the coding agent needs to run commands inside the container, or restart the container, inspect logs etc.

If the agent is outside the container, it can run docker (compose) commands and do all that, and it works great. If the agent however is inside the container, it can't. Without mapping the socket that is.


i see what you are saying now, i have actually started doing my own dockerfiles so everything is in one container it works reasonably well actually eg you install postgres redis x y and z on the same thing the agent is running on then you can start fresh anytime then all of your stuff is on localhost



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: