migrating-dockerfiles-to-chainguard

migrating-dockerfiles-to-chainguard is a skill for Claude Code from chainguard-demo/claude-plugins. It costs 24 tokens per session (1,985 once invoked), scanned C, original, Apache-2.0.

A step-by-step guide for converting existing Dockerfiles to use Chainguard images, which are container images designed with security in mind.

In plain words
What is it for?
Use it to change Dockerfile base images, adapt package installation, adjust permissions, build the image, run it, and troubleshoot failures.
Why use it?
It covers the common changes that can break a conversion, including image names, package managers, users, permissions, and validation.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the chainguard-codegen plugin — 6 skills, 1 MCP server shipped together

Good fit Use it to change Dockerfile base images, adapt package installation, adjust permissions, build the image, run it, and troubleshoot failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chainguard-demo/claude-plugins/migrating-dockerfiles-to-chainguard
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.

Any agent
npx skills add chainguard-demo/claude-plugins --skill migrating-dockerfiles-to-chainguard
Clone the repo
git clone --depth 1 https://github.com/chainguard-demo/claude-plugins

Made for: Claude Code.

Or install chainguard-codegen, the plugin that ships this one along with the rest of its 6 skills, 1 MCP server.

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 migrating-dockerfiles-to-chainguard

README.md
[![agentmods](https://agentmods.dev/badge/skills/chainguard-demo/claude-plugins/migrating-dockerfiles-to-chainguard/github.svg)](https://agentmods.dev/skills/chainguard-demo/claude-plugins/migrating-dockerfiles-to-chainguard)
Your own site
<a href="https://agentmods.dev/skills/chainguard-demo/claude-plugins/migrating-dockerfiles-to-chainguard"><img src="https://agentmods.dev/badge/skills/chainguard-demo/claude-plugins/migrating-dockerfiles-to-chainguard/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for migrating-dockerfiles-to-chainguard

Your own site · 80×15
<a href="https://agentmods.dev/skills/chainguard-demo/claude-plugins/migrating-dockerfiles-to-chainguard"><img src="https://agentmods.dev/badge/skills/chainguard-demo/claude-plugins/migrating-dockerfiles-to-chainguard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,985 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00024 $0.01985
Opus 5 $0.00012 $0.00992
Sonnet 5 $0.00005 $0.00397
Haiku 4.5 $0.00002 $0.00198

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

Security

Grade C, and why

migrating-dockerfiles-to-chainguard scanned grade C 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 11d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf /var/cache/yum/*
chainguard-codegen/skills/migrating-dockerfiles-to-chainguard/SKILL.md · 248 lines

How it starts

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

To convert a Dockerfile to use Chainguard images you should follow these steps:

  1. Clarify instructions with the user
  2. Convert the Dockerfile
    1. Modify FROM statements to use Chainguard images.
    2. Migrate any uses of other OS package managers to apk
    3. Adjust users and permissions where required.
  3. Test the conversion
    1. Build the image
    2. Run the image
    3. Troubleshoot any failures

Clarify Instructions

If you're asked to convert a Dockerfile to Chainguard, before doing anything else, you should clarify the following with the user:

  1. What is the Chainguard organization name? Each Chainguard customer has their own organization and it will be referred to generically as ORGANIZATION in these instructions.
  2. Is FIPS required? Chainguard offers FIPS compliant images that have the suffix -fips. For instance: python-fips.
  3. Should images be pulled directly from cgr.dev? Or, if images are hosted/proxied from another repository, what is that repository?
  4. Should you test the conversion?
    1. Should you try and build the image to validate the conversion worked?
    2. Should you try and run the image to validate the conversion worked?

Store these answers under ~/.claude/chainguard-preferences.md and try and reuse this file across subsequent asks to migrate Dockerfiles.

Backup the Dockerfile

You should backup the old Dockerfile by prepending old. to it. For instance, Dockerfile -> old.Dockerfile.

Then you can modify the original file directly.

Converting FROM statements

You should replace images defined in FROM lines with the equivalent Chainguard image.

Always use the mapping-container-images-to-chainguard skill if it is available.

You should try to match to actively maintained tags when converting Dockerfiles.

You should prefer -dev tags as they have more utilities in them and they are less likely to cause issues. One known exception is chainguard-base which has no -dev variant. You should always use the latest tag for chainguard-base.

Read the full file on GitHub · 248 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. 11d ago First seen · 248 lines · 24 tokens per session scan C a41419320d0b

Subscribe to this mod's changes

migrating-dockerfiles-to-chainguard is a skill published in the GitHub repository chainguard-demo/claude-plugins (7 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 24 tokens to every session and 1,985 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

build-mcpb

This skill should be used when the user wants to "package an MCP server", "bundle an MCP", "make an MCPB", "ship a local MCP server", "distribute a local MCP", discusses ".mcpb files", mentions bundling a Node or Python runtime with their MCP server, or needs an MCP server that interacts with the local filesystem…

anthropics/claude-plugins-official · 98 tokens

nextjs-deployment

Provides comprehensive patterns for deploying Next.js applications to production. Use when configuring Docker containers, setting up GitHub Actions CI/CD pipelines, managing environment variables, implementing preview deployments, or setting up monitoring and logging for Next.js applications. Covers standalone output…

giuseppe-trisciuoglio/developer-kit · 71 tokens

opencode-sandbox

Run OpenCode in a docker-dev sandbox (SSH/gh on by default; --no-ssh/--no-github to isolate). Prints docker exec attach; kept until you confirm rm. Don't use for opencode.ai (opencode-runner), Herdr, or the app.

luongnv89/skills · 63 tokens

escaping-hardened-containers

Escape containers that drop capabilities, enforce seccomp profiles, and run behind AppArmor or SELinux — enumerating residual capabilities, analyzing seccomp filters, abusing single-capability escapes, cgroup release agents, filesystem mounts, and runtime CVEs. Use when a container has no --privileged flag but retains…

trilwu/secskills · 105 tokens

pentest-cloud-infrastructure

Cloud security posture management and container security assessment for AWS, Azure, GCP, and Kubernetes.

jd-opensource/JoySafeter · 25 tokens

configure-log-aggregation

Set up centralized log aggregation with Loki and Promtail (or ELK stack), including log parsing, label extraction, retention policies, and integration with metrics for correlation. Use when consolidating logs from multiple services into a searchable system, replacing local log files with centralized queryable storage…

pjt222/agent-almanac · 86 tokens