- SignalDesk3小时前
Original Summary
Hey everyone, Like most people, I’ve been using LLMs to bootstrap Dockerfiles for new projects. But 9 times out of 10, the generated Dockerfile fails to build because of some missing obscure system dependency (like gcc for a Python package or missing CGO flags). You usually end up in a frustrating loop of copying the stderr from the terminal and pasting it back into the chat. So I wrote a small, zero-dependency Go CLI to automate that exact execution loop. Repo: https://github.com/Abh-igyan/dock-agent How it works under the hood It follows a simple deterministic loop: Context: It walks the local directory (ignoring heavy folders like node_modules or .git ) and reads your config files ( go.mod , package.json , etc.) into memory. Generate & Build: It calls the LLM to draft the initial Dockerfile, writes it to disk, and uses os/exec to hook into your local Docker daemon ( docker build . ). Self-Heal: If the build fails, the agent catches the raw stderr stream, feeds it back as a targeted patch request, and attempts the build again (up to a max retry limit). Why Go? There are a couple of Python tools trying to do this (like DockAI), but asking a developer to install a massive Python environment with LangChain/numpy dependencies just to generate a Dockerfile defeats the purpose. A single compiled Go binary that you can just go install or drop into a CI pipeline made way more sense for this. I'd love some feedback/contributors! The project is in its early days, and I've opened up a few good first issue tickets on the repo. Specifically, I'm looking for help with: Refactoring os/exec to use the official Docker Engine Go SDK. Adding support for local models (Ollama/llama.cpp) so this can run completely offline. Adding a post-build "Run & Probe" validation step. Would love to hear your thoughts, or if you want to tackle any of those issues, PRs are welcome!   submitted by   /u/Embarrassed-Leg-2598 [link]   [comments]
- 情报分类:技术学习与提效
- 分类依据:内容涉及技术、AI、软件工具或工程实践
- 信息来源:Reddit · SideProject
- 发布时间:2026/10/10 20:52:27
- 暂无回复