4 ms·
You can eject to host.docker.internal it’s the easiest way
by waynenilsen 9mo ago
You can eject to host.docker.internal it’s the easiest way
- gingerlime 9mo agoNot sure I understand what you mean. Could you explain?
- waynenilsen 9mo agosay 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?
- gingerlime 9mo agoThanks. 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.
- waynenilsen 9mo agoi 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