dockerfile

dockerfile is a skill for Claude Code, Codex from chaterm/terminal-skills. It costs 9 tokens per session (1,933 once invoked), scanned C, original, Apache-2.0.

A guide to writing Dockerfiles, which are instruction files used to build Docker images. Docker images package an application and its required files so it can run consistently in different environments.

In plain words
What is it for?
Use it to write or review Dockerfiles for Node.js, Python, Ubuntu, or similar applications, including build stages, working directories, commands, files, and startup behavior.
Why use it?
It explains how to choose a starting image, copy application files, install software, and define the startup command. It also covers smaller builds, multi-stage builds, and basic security scanning practices.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/node/app.

Good fit Use it to write or review Dockerfiles for Node.js, Python, Ubuntu, or similar applications, including build stages, working directories, commands, files, and startup behavior.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

Made for: Claude Code, Codex.

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 dockerfile

README.md
[![agentmods](https://agentmods.dev/badge/skills/chaterm/terminal-skills/dockerfile.svg)](https://agentmods.dev/skills/chaterm/terminal-skills/dockerfile)
Your own site
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/dockerfile"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/dockerfile.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,933 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. 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.00009 $0.01933
Opus 5 $0.00005 $0.00966
Sonnet 5 $0.00002 $0.00387
Haiku 4.5 $0.00001 $0.00193

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

Security

Grade C, and why

dockerfile scanned grade C with 2 findings 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 8d 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/lib/apt/lists/*

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

RUN apt-get update && apt-get install -y curl
docker/dockerfile/SKILL.md · 374 lines

How it starts

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

Dockerfile 编写

概述

Dockerfile 最佳实践、安全扫描等技能。

指令详解

FROM

# 基础镜像
FROM ubuntu:22.04
FROM node:18-alpine
FROM python:3.11-slim

# 多阶段构建
FROM node:18 AS builder
FROM nginx:alpine AS production

# 使用 ARG 动态指定
ARG BASE_IMAGE=node:18-alpine
FROM ${BASE_IMAGE}

WORKDIR

# 设置工作目录(推荐使用绝对路径)
WORKDIR /app
WORKDIR /home/node/app

# 多次使用会切换目录
WORKDIR /app
WORKDIR src
# 当前目录: /app/src

COPY 与 ADD

# COPY(推荐)
COPY package.json ./
COPY src/ ./src/
COPY --chown=node:node . .

# 多文件复制
COPY package.json package-lock.json ./

# ADD(支持 URL 和解压)
ADD https://example.com/file.tar.gz /app/
ADD archive.tar.gz /app/           # 自动解压

# 推荐:优先使用 COPY,除非需要 ADD 的特殊功能

RUN

# Shell 形式
RUN apt-get update && apt-get install -y curl

# Exec 形式
RUN ["apt-get", "update"]

# 最佳实践:合并命令减少层数
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        curl \
        wget \
        git && \
    rm -rf /var/lib/apt/lists/*

CMD 与 ENTRYPOINT

# CMD - 默认命令(可被覆盖)
CMD ["node", "app.js"]
CMD ["npm", "start"]

# ENTRYPOINT - 入口点(不易被覆盖)
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["postgres"]

# 组合使用
ENTRYPOINT ["python"]
CMD ["app.py"]
# 运行: python app.py
# docker run myimage other.py -> python other.py

ENV 与 ARG

# ENV - 运行时环境变量
ENV NODE_ENV=production
ENV PORT=3000 HOST=0.0.0.0

# ARG - 构建时参数
ARG VERSION=1.0
ARG BUILD_DATE

# ARG 转 ENV
ARG APP_VERSION
ENV APP_VERSION=${APP_VERSION}

# 使用构建参数
# docker build --build-arg VERSION=2.0 .

EXPOSE

# 声明端口(文档作用)
EXPOSE 80
EXPOSE 443
EXPOSE 3000/tcp
EXPOSE 5000/udp

VOLUME

# 声明挂载点
VOLUME /data
VOLUME ["/data", "/logs"]

USER

# 切换用户
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser

# 或使用 UID
USER 1000:1000

HEALTHCHECK

# 健康检查
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
    CMD curl -f http://localhost/ || exit 1

# 禁用健康检查
HEALTHCHECK NONE

Read the full file on GitHub · 374 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. 8d ago First seen · 374 lines · 9 tokens per session scan C b72d865c03af

Subscribe to this mod's changes

dockerfile is a skill published in the GitHub repository chaterm/terminal-skills (58 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 9 tokens to every session and 1,933 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

docker

Use when authoring or auditing a Dockerfile, shrinking a bloated image, hardening a container that runs as root, picking a base image, or wiring a Compose dev loop with hot reload. NOT CI builds or deploy-to-host (that is deployment), NOT k8s autoscaling (that is scaling), NOT app-level injection or secrets-in-code…

ericrisco/rsc-harness · 86 tokens

ilo

Run builds, tests, and other tooling inside a reproducible, containerized dev environment via the ilo CLI instead of on the host. Use this whenever a project relies on ilo, devcontainers, or container-based build environments — it has a .ilo.rc / .ilo/ilo.rc, dev/ argument files, a Containerfile/Dockerfile, a…

metio/ilo · 181 tokens

docker

Operational skill for Claude to automate Docker via CLI, Dockerfiles, Compose, BuildKit, multi-stage builds, and container networking hygiene.

alivirgo/Major-AI-Skills · 29 tokens

docker-essentials

Create and optimize Dockerfiles, docker-compose configurations, and container workflows. Use when containerizing applications, setting up development environments, or optimizing Docker builds.

asgarovf/locusai · 35 tokens

docker-management

Docker container lifecycle management, Dockerfile authoring, and debugging.

furkangonel/cowrangler · 16 tokens

harbor

CLI toolkit for managing containerized LLM services. Use when the user wants to start, stop, configure, or manage AI/LLM services like Ollama, Open WebUI, llama.cpp, vLLM, LiteLLM, ComfyUI, and 250+ others. Triggers on requests to "run a model", "start ollama", "set up an LLM", "configure harbor", "manage services"…

av/harbor · 114 tokens