go-containers

go-containers is a skill for Claude Code from laurigates/claude-plugins. It costs 47 tokens per session (3,029 once invoked), scanned B, original, MIT.

A guide to making small Docker images for Go programs by compiling static binaries and using minimal runtime images. A static binary includes what it needs to run without extra system libraries.

In plain words
What is it for?
Building and reviewing Go Dockerfiles, choosing minimal base images, and handling static linking or CGO.
Why use it?
It reduces image size and removes runtime components that a compiled Go program does not need.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the TodoWrite tool; positional $N argument.

Part of the container-plugin plugin — 7 skills, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/laurigates/claude-plugins/go-containers
Any agent
npx skills add laurigates/claude-plugins --skill go-containers
Clone the repo
git clone --depth 1 https://github.com/laurigates/claude-plugins

Made for: Claude Code.

Or install container-plugin, the plugin that ships this one along with the rest of its 7 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-containers

README.md
[![agentmods](https://agentmods.dev/badge/skills/laurigates/claude-plugins/go-containers.svg)](https://agentmods.dev/skills/laurigates/claude-plugins/go-containers)
Your own site
<a href="https://agentmods.dev/skills/laurigates/claude-plugins/go-containers"><img src="https://agentmods.dev/badge/skills/laurigates/claude-plugins/go-containers.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,029 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00047 $0.03029
Opus 5 $0.00023 $0.01515
Sonnet 5 $0.00009 $0.00606
Haiku 4.5 $0.00005 $0.00303

Measured 2d ago against content hash 76683bd3215c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

go-containers scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- Run as root user (even in scratch, use `USER 65534`)
container-plugin/skills/go-containers/SKILL.md · 417 lines

How it starts

The opening of the file, as written. The whole thing — 417 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Go Container Optimization

Expert knowledge for building minimal, secure Go container images using static compilation, scratch/distroless base images, and Go-specific build optimizations.

When to Use This Skill

Use this skill when... Use container-development instead when...
Building or auditing a Dockerfile for a Go application Writing language-agnostic multi-stage build patterns
Choosing between scratch, distroless, and Alpine for a Go binary Hardening any container against non-root / least-privilege standards
Driving down a Go image from hundreds of MB to single-digit MB Composing services with Docker Compose
Resolving CGO / static-link issues specific to Go Optimizing a Node.js (nodejs-containers) or Python (python-containers) image

Core Expertise

Go's Unique Advantages:

  • Compiles to single static binary (no runtime dependencies)
  • Can run on scratch base (literally empty image)
  • No interpreter, VM, or system libraries needed at runtime
  • Enables smallest possible container images (2-5MB)

Key Capabilities:

  • Static binary compilation with CGO_ENABLED=0
  • Binary stripping with ldflags (-w, -s)
  • Scratch and distroless base images
  • CA certificate handling for HTTPS
  • CGO considerations when C libraries are required

The Optimization Journey: 846MB → 2.5MB

This demonstrates systematic optimization achieving 99.7% size reduction:

Step 1: The Problem - Full Debian Base (846MB)

# ❌ BAD: Includes full Go toolchain, Debian system, unnecessary tools
FROM golang:1.23
WORKDIR /app
COPY . .
RUN go build -o main .
EXPOSE 8080
CMD ["./main"]

Issues:

  • Full Debian base (~116MB)
  • Complete Go compiler and toolchain (~730MB)
  • System libraries, package managers, shells
  • None of this is needed at runtime

Image size: 846MB

Step 2: Switch to Alpine (312MB)

# ✅ BETTER: Alpine reduces OS overhead
FROM golang:1.23-alpine
WORKDIR /app
COPY . .
RUN go build -o main .
EXPOSE 8080
CMD ["./main"]

Read the full file on GitHub · 417 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 417 lines · 47 tokens per session scan B 76683bd3215c

Subscribe to this mod's changes

go-containers is a skill published in the GitHub repository laurigates/claude-plugins (58 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 3,029 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.