Analyze Docker Image Size logo

Analyze Docker Image Size

Community
dykyi-roman
analyze-docker-image-size

Analyzes Docker image size for PHP projects. Identifies bloated layers, unnecessary packages, and provides size reduction strategies.

Overview

Publisherdykyi-roman
Repositoryawesome-claude-code
Skill nameanalyze-docker-image-size
Stars
98
Forks
25
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dykyi-roman on GitHub. Read the source before you install it.

Installation

Install the Analyze Docker Image Size AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git /tmp/awesome-claude-code
mkdir -p .claude/skills
cp -r /tmp/awesome-claude-code/skills/analyze-docker-image-size .claude/skills/analyze-docker-image-size
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Analyze Docker Image Size in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Analyze Docker Image Size on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Analyze Docker Image Size is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Docker Image Size Analysis

Analyze Docker images for PHP projects to identify bloat sources and provide size reduction strategies.

Expected Size Ranges

Base ImageMinimalTypicalBloated
php:8.4-fpm-alpine30-50 MB80-120 MB200+ MB
php:8.4-fpm (Debian)150-200 MB250-350 MB500+ MB
php:8.4-cli-alpine25-40 MB60-100 MB180+ MB

Common Bloat Sources

1. Build Dependencies Not Cleaned

dockerfile
# BLOATED: Dev packages remain in final image
RUN apk add --no-cache $PHPIZE_DEPS icu-dev libzip-dev \
    && docker-php-ext-install intl zip

# OPTIMIZED: Remove build deps after compilation
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS icu-dev libzip-dev \
    && docker-php-ext-install intl zip \
    && apk del .build-deps \
    && apk add --no-cache icu-libs libzip

2. Vendor with Dev Dependencies

dockerfile
# BLOATED: Includes dev dependencies (+30-80MB)
RUN composer install

# OPTIMIZED: No dev dependencies, optimized autoloader
RUN composer install --no-dev --no-scripts --prefer-dist --optimize-autoloader

3. Full Debian Instead of Alpine

dockerfile
# BLOATED: Full Debian base (~150MB base)
FROM php:8.4-fpm

# OPTIMIZED: Alpine base (~30MB base)
FROM php:8.4-fpm-alpine

4. Package Manager Cache

dockerfile
# BLOATED: apt cache retained (~30-50MB)
RUN apt-get update && apt-get install -y libicu-dev

# OPTIMIZED: Clean apt cache in same layer
RUN apt-get update && apt-get install -y --no-install-recommends libicu-dev \
    && rm -rf /var/lib/apt/lists/*

5. Missing .dockerignore

dockerignore
.git
node_modules
vendor
tests
docs
var/cache
var/log
docker-compose*.yml
.env.local
*.md
Makefile

Size Estimation by Component

ComponentTypical SizeNotes
Alpine base5-8 MBMinimal Linux
Debian slim base70-90 MBMore packages available
PHP runtime25-40 MBCore PHP binaries
PHP extensions (5-8)10-30 MBDepends on extensions
Composer vendor (no-dev)20-60 MBDepends on packages
Composer vendor (with-dev)50-150 MBPHPUnit, etc.
Application code1-10 MBSource files only
Build dependencies50-200 MBMust be cleaned

Multi-Stage Build (Best Practice)

dockerfile
FROM php:8.4-fpm-alpine AS builder
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS icu-dev libzip-dev \
    && docker-php-ext-install intl zip opcache \
    && apk del .build-deps
COPY composer.json composer.lock ./
RUN composer install --no-dev --prefer-dist --optimize-autoloader

FROM php:8.4-fpm-alpine AS runtime
RUN apk add --no-cache icu-libs libzip
COPY --from=builder /usr/local/lib/php/extensions/ /usr/local/lib/php/extensions/
COPY --from=builder /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/
COPY --from=builder /var/www/vendor /var/www/vendor
COPY . /var/www/

Grep Patterns

bash
# Find base images used
Grep: "^FROM " --glob "**/Dockerfile*"

# Find missing cache cleanup
Grep: "apt-get install" --glob "**/Dockerfile*"
Grep: "apk add(?!.*--no-cache)" --glob "**/Dockerfile*"

# Find composer install without --no-dev
Grep: "composer install(?!.*--no-dev)" --glob "**/Dockerfile*"

# Find COPY . (copies everything)
Grep: "^COPY \. " --glob "**/Dockerfile*"

# Check for .dockerignore
Glob: "**/.dockerignore"

# Find multi-stage builds
Grep: "^FROM.*AS " --glob "**/Dockerfile*"

Reduction Impact

StrategySize ReductionEffort
Alpine instead of Debian100-150 MBLow
Multi-stage build50-200 MBMedium
Remove build deps50-200 MBLow
--no-dev Composer30-80 MBLow
Clean apt/apk cache20-50 MBLow
.dockerignore10-500 MBLow

Severity Classification

PatternSeverityTypical Waste
No multi-stage, build deps remainCritical100-300 MB
No .dockerignore, .git copiedCritical50-500 MB
Debian instead of Alpine (no reason)Major100-150 MB
Composer with dev dependenciesMajor30-80 MB
APT/APK cache not cleanedMinor20-50 MB

Output Format

markdown
### Image Size Issue: [Category]

**Severity:** Critical/Major/Minor
**Current Size:** X MB
**Estimated Savings:** Y MB
**Layer:** Dockerfile:line

**Issue:**
[Description of the bloat source]

**Current:**
```dockerfile
// Current Dockerfile instruction

Optimized:

dockerfile
// Optimized Dockerfile instruction

Expected Size After Fix: Before: X MB -> After: Z MB (saved Y MB)

Frequently asked questions

What does the Analyze Docker Image Size AI skill do?

Analyzes Docker image size for PHP projects. Identifies bloated layers, unnecessary packages, and provides size reduction strategies.

Why use Analyze Docker Image Size on TypingMind?

Because you install it once and use it with any model. Analyze Docker Image Size is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Analyze Docker Image Size in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/analyze-docker-image-size. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Analyze Docker Image Size?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Analyze Docker Image Size?

As many as you like. As long as a model supports skills, you can use Analyze Docker Image Size with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Analyze Docker Image Size AI skill free?

Yes. It is published on GitHub by dykyi-roman under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇