Skip to content
Agentmart
Submit a tool

Docker Image Optimizer Devops

Audits and refactors Dockerfiles to reduce image size, improve security and speed up build times.

Skill by vivek-viswanat

IndexedMIT★ 4
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/vivek-viswanat-docker-image-optimizer-devops

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Audits and refactors Dockerfiles to reduce image size, improve security and speed up build times.

Use cases: devops, security

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/docker-image-optimizer-devops

What's inside

Skill name
Docker Image Optimizer Devops
Description
Audits and refactors Dockerfiles to reduce image size, improve security and speed up build times.
License
MIT
Instructions
34 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • name: only lowercase letters, digits and single hyphens allowed
  • name: "Docker Image Optimizer Devops" does not match folder "docker-image-optimizer-devops"

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Context
Use this skill when:
1. Creating a new `Dockerfile`
2. A user complains about "slow builds" or "large images"
3. Reviewing container security (reducing attack surface)

# Optimization Pillars

### 1. Multi-Stage Strategy (The 2026 Standard)
- **Separate Build from Runtime:** Use a heavy image (with compilers/SDKs) for building, but copy ONLY the final binary/artifacts into a minimal runtime image (Alpine or Scratch).
- **Named Stages:** Use `FROM base AS builder` for readability.

### 2. Base Image Selection
- **Prefer Minimal:** Default to `alpine` (≈5MB) or `debian-slim` (≈30MB) over `ubuntu:latest` (≈75MB).
- **Distroless:** For production, suggest `gcr.io/distroless` to remove all shells and package managers.

### 3. Layer Management & Caching
- **Order Matters:** Place instructions that change least often (like `RUN apt-get update`) at the top. Place source code `COPY` commands at the bottom.
- **Atomic RUNs:** Combine related commands using `&&` and `\` to prevent intermediate layer bloat. 
  *Example:* `RUN apt-get update && apt-get install -y --no-install-recommends pkg && rm -rf /var/lib/apt/lists/*`

### 4. Dependency Hygiene
- **No-Install-Recommends:** Always use `--no-install-recommends` with `apt`.
- **Cache Cleaning:** Remove package manager caches in the *same* layer as the installation.
- **Production Only:** Ensure `devDependencies` or build-only headers never reach the final stage.

### 5. The .dockerignore File
- **Exclusion:** Every Docker project MUST have a `.dockerignore` to prevent `.git`, `node_modules`, `tests/`, and local logs from leaking into the build context.

# Instructions for the Agent
- When a user provides a Dockerfile, perform a **Size Audit** first.
- If the image is single-stage, provide a **Refactored Multi-Stage Version**.
- Check for "Magic Versions" and suggest pinning specific tags (e.g., `node:22.1.0-alpine` instead of `node:latest`).

From vivek-viswanat/dev-arsenal, MIT.

Signals

Stars
4
Forks
1
Open issues
1
Last commit (this folder)
Mar 8, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from vivek-viswanat

Cite this page

Docker Image Optimizer Devops skill. Agent Mart. https://agentmart.dev/skills/vivek-viswanat-docker-image-optimizer-devops (last updated 2026-10-24)