Show HN: Dockershrink – AI Assistant to reduce the size of Docker images For the past few months, I've been hacking around a project I call Dockershrink. It automates a simple task: Take a Dockerfile and optimize its code with the goal of reducing the size of the final Docker image. People don't realize that we can apply some very basic techniques to reduce, for eg, a 2GB image down to just ~100MB: - Multistage builds with light-weight base image for final stage - Remove unused dependencies - Optimizations specific to the tech stack And I feel like I've already done this optimization for my personal projects and backend apps at my job(s) a couple of times. The project currently uses GPT-4o (open source so you can run it locally) and only works for Nodejs projects. There are a couple of reasons why I think dockershrink can be better than using just Vanilla LLM or Github Copilot/Cursor: - Image optimization can benefit from a lot of custom prompting, especially when you have insights about specific tech stacks. Describing techniques deeply in the prompt gave better results than simply asking the LLM to "optimize code for bloat reduction". - A RAG approach will be truly beneficial. I plan on giving dockershrink access to up-to-date documentations of Docker, Bash and all programming languages out there. Additionally, it can be given a few suitable chunks of code to enhance the context. - Analysing custom base images: most orgs have their customized base images. Adding context about these can further help Dockershrink make better decisions. Try it out - "brew install dockershrink" Happy to hear your thoughts! https://ift.tt/VjRiBmp February 14, 2025 at 04:15AM
Show HN: Dockershrink – AI Assistant to reduce the size of Docker images https://ift.tt/vpyHXUe
Related Articles
Show HN: Oration (iOS) turns pdfs into audiobooks https://ift.tt/vnOYIRUShow HN: Oration (iOS) turns pdfs into audiobooks Hello HN community! … Read More
Show HN: Teaching my 2y old son animal sounds https://ift.tt/XN1d7t4Show HN: Teaching my 2y old son animal sounds Hi, Hacker News! To teac… Read More
Show HN: AED Map – Mobile App for Automated External Defibrillators https://ift.tt/QIbsj5BShow HN: AED Map – Mobile App for Automated External Defibrillators I'… Read More
Show HN: Swift Mail, a native macOS app for JMAP mail https://ift.tt/EBMJwcNShow HN: Swift Mail, a native macOS app for JMAP mail Hello HN! I'm ex… Read More
Show HN: Aurora- a comprehensive set of Statistics and Machine Learning tools https://ift.tt/2B4q6kFShow HN: Aurora- a comprehensive set of Statistics and Machine Learnin… Read More
Show HN: The Namingless Programming Language https://ift.tt/mDS4tFcShow HN: The Namingless Programming Language A programming language th… Read More
Show HN: I built a simple daily budgeting app for me and my wife https://ift.tt/sRGue28Show HN: I built a simple daily budgeting app for me and my wife https… Read More
Show HN: Bitwise Liminal – A Short Film in 256 Bytes of Code https://ift.tt/20E76GHShow HN: Bitwise Liminal – A Short Film in 256 Bytes of Code Bitwise L… Read More
0 Comments: