2 ms·
I do (most of) my development in docker containers. Usually a project will have a docker compose with web server, database etc. How can I use this so the yolob
by gingerlime 9mo ago
I do (most of) my development in docker containers. Usually a project will have a docker compose with web server, database etc.
How can I use this so the yolobox container can interact with the other docker containers (or docker compose)?
- Finbarr 9mo agoThis is a good question and something I explored a little. I’ll need to do further research and come back on what the best option is. There’s a way to give a docker container access to other docker containers but it can open up permissions more than might be desired here.
- gingerlime 9mo agoYeah, you can bind mount the host's docker engine with -v /var/run/docker.sock:/var/run/docker.sock ... but yeah, it's potentially dangerous and might also get confusing for the AI agent and/or the user.
- waynenilsen 9mo agoYou 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