dockershrink

by duaraghav8Verified

AI Assistant that reduces the size of your application's Docker Image

417
Stars
56
Forks
Go
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/duaraghav8/dockershrink

Getting Started

Guides for using skills like dockershrink.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

DockerShrink

Talk to us on Slack | Vote for Feature Requests


Dockershrink is an AI-powered Commandline Tool that helps you reduce the size of your Docker images

Typical interaction with dockershrink CLI

It combines the power of algorithmic analysis with Generative AI to apply state-of-the-art optimizations to your Image configurations :brain:

Dockershrink can automatically apply techniques like Multi-Stage builds, switching to Lighter base images like alpine and running dependency checks. PLUS a lot more is on the roadmap :rocket:

Currently, the tool only supports NodeJS applications.

It can:

  1. Generate optimized Docker image defintions (Dockerfile and .dockerignore) for new projects
  2. Optimize existing image definition by including best practices to avoid bloat

[!IMPORTANT] Dockershrink is BETA software.

You can provide your feedback by creating an Issue in this repository.

Why does dockershrink exist?

Every org using containers in development or production environments understands the pain of managing hundreds or even thousands of bloated Docker images in their infrastructure.

High data storage and transfer costs, long build times, underprodctive developers - we've seen it all.

The issue becomes even more painful and costly with interpreted languages such as Nodejs & Python. Apps written in these languages need to pack the interpreters and all their dependencies inside their container images, significantly increasing their size.

But not everyone realizes that by just implementing some basic techniques, they can reduce the size of a 1GB Docker image down to as little as 100 MB!

(I also made a video on how to do this.)

Imagine the costs saved in storage & data transfer, decrease in build times AND the productivity gains for developers :exploding_head:

Dockershrink aims to automatically apply advanced optimization techniques so engineers don't have to waste time on it and the organization still saves :moneybag:!

You're welcome :wink:

Installation

Dockershrink is shipped as a stand-alone binary.

You can either download it from the Releases Page or use Homebrew to install it:

$ brew install duaraghav8/tap/dockershrink

[!IMPORTANT] On MacOS, you will have to use homebrew because the compiled binary is not Notarized.

Usage

Navigate into the root directory of your Node.js project and invoke dockershrink:

# To optimize existing Docker-related files
$ dockershrink optimize

# To generate new Docker files
$ export DOCKERSHRINK_API_KEY=...
$ dockershrink generate

Dockershrink creates a new directory which contains the files produced by it. By default, this directory is dockershrink.out.

For detailed information about a command, run

$ dockershrink help optimize
$ dockershrink help generate

You can also use the --debug option to get DEBUG logs. These are especially helpful during troubleshooting.

$ dockershrink generate --debug

Using AI Features

[!NOTE] Using AI features is optional for "optimize" (but highly recommended) and mandatory for "generate".

Dockershrink can use any OpenAI-compatible API endpoint for its AI features. This includes OpenAI, Anthropic, and AWS Bedrock.

If you want to enable AI, you must supply your API key and (optionally) a custom base URL for your chosen endpoint.

Requests will be sent to OpenAI's API by default, if no base URL is provided.

So even though Dockershrink itself is free, LLM usage might incur some cost for you.

dockershrink optimize --api-key <your endpoint's api key> --base-url <your endpoint's base url>

Or set them as environment variables:

export DOCKERSHRINK_API_KEY="<your endpoints api key>"
export DOCKERSHRINK_BASE_URL="<your endpoints base url>"
dockershrink generate

Examples:

  • OpenAI (default):

    export DOCKERSHRINK_API_KEY="<your OpenAI API key>"
    dockershrink generate
    
  • AWS Bedrock:

    export DOCKERSHRINK_API_KEY="<your bedrock key>"
    export DOCKERSHRINK_BASE_URL="http://your-bedrock-endpoint"
    dockershrink generate
    
  • Ollama:

    # Assumes you are running a model that [supports tool calling](https://ollama.com/blog/tool-support) locally with Ollama
    dockershrink optimize --api-key 'ollama' --model "llama3.1"
    

[!NOTE] Dockershrink does not store your provided API Key.

So you must provide your key every time you want Dockershrink to use it. This is to avoid any unexpected costs.


Development :computer:

[!NOTE] This section is for authors and contributors. If you're simply interested in using Dockershrink, you can skip it.

Prerequisites

  • Clone this repository on to your local machine.
  • Make sure Golang is installed on your system (at least version 1.23)
  • Make sure Docker installed on your system and the Docker daemon is running.
  • Install GoReleaser (at least version 2.4)

Development

  1. After cloning this repository, navigate inside the root directory of the project
  2. Run tests to ensure everything is working
go test ./...
  1. Make your code changes, add relevant tests.
  2. Tidy up and make sure all tests pass
go mod tidy
go mod vendor
go test ./...

Build for local testing

# Single binary
goreleaser build --single-target --clean --snapshot

# All binaries
goreleaser release --snapshot --clean

Create a new release

  1. Create a Git Tag with the new version
git tag -a v0.1.0 -m "Release version 0.1.0"
git push origin v0.1.0
  1. Release
# Make sure GPG is present on your system and you have a default key which is added to Github.

# set your github access token
export GITHUB_TOKEN="<your GH token>"

goreleaser release --clean

This will create a new release under Releases and also make it available via Homebrew.

Frequently Asked Questions

What is dockershrink?

dockershrink is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by duaraghav8. AI Assistant that reduces the size of your application's Docker Image. It has 417 GitHub stars.

Is dockershrink safe to use?

Yes. dockershrink passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install dockershrink?

Clone the repository with "git clone https://github.com/duaraghav8/dockershrink" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is dockershrink written in?

dockershrink is primarily written in Go. It is open-source under duaraghav8 on GitHub, so you can review or fork the full source.

Are there alternatives to dockershrink?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh dockershrink against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details