[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74GAVEH9G91XHAY6DR4T1F5":3,"skill-same:01M74GAVEH9G91XHAY6DR4T1F5":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M74GAVEH9G91XHAY6DR4T1F5","dockerize",null,"Write a multi-stage Dockerfile — distroless or minimal base, build\u002Fruntime split, deterministic layer order, non-root user, no secrets baked in.","MohammadBafkar\u002Fpolymath","MohammadBafkar","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F34940462?v=4","01M74G540TQFZWK6KVAPKFVGNR","Mohammad Bafkar","01M74G541HG19QP9V5DQCJVKYE",0,"MIT","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-devops\u002Fskills\u002Fdockerize\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: dockerize\ndescription: Write a multi-stage Dockerfile — distroless or minimal base, build\u002Fruntime split, deterministic layer order, non-root user, no secrets baked in.\n---\n\n# dockerize\n\n> Write a Dockerfile that's small, fast to rebuild, and safe to run.\n\n**Mode:** analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked `[TBD]` or `[VERIFY]`, never filled in.\n\n## When to use\n\n- A new service needs a container image.\n- An existing Dockerfile is bloated, slow, or runs as root.\n\n## Inputs\n\n- Language + framework.\n- Build artifact shape (compiled binary, JS bundle, Python module).\n- Runtime needs (does it need `bash`, `curl`, `ca-certificates`? Often: no.).\n\n## Project localization\n\nBefore the procedure, resolve the project snapshot —\n`${POLYMATH_DATA_DIR:-$HOME\u002F.polymath\u002Fdata}\u002Fpolymath-core\u002Fproject-context.json`\n(ignore it if its `_meta.source` belongs to another repo; absent → read\n`.polymath\u002Fproject.yaml` directly; neither → built-in defaults). Then apply\n(contract: `polymath-core:project-context`):\n\n- `conventions_docs`: read role `deployment` — approved base images,\n  registries, and hosting targets there override the generic choices\n  below.\n\n## Procedure\n\n1. **Multi-stage** always. Stage 1 builds; stage 2 runs.\n2. **Base images**:\n   - **Builder stage**: the official language image with the toolchain (e.g. `golang:1.22-alpine`, `node:20-alpine`, `python:3.12-slim`).\n   - **Runtime stage**: pick from smallest to most flexible:\n     - **`scratch`** — Go static binaries, Rust musl. Cheapest.\n     - **`gcr.io\u002Fdistroless\u002Fstatic`** \u002F `base` \u002F `cc` — no shell, no package manager. Recommended for compiled languages.\n     - **`-slim`** (debian-slim, python-slim) — for languages needing libc + a tiny userspace.\n     - **`-alpine`** — only if you've validated musl compatibility (Python wheels often don't).\n3. **Layer order** — most-cacheable first:\n   1. Copy dependency manifests (`go.mod`, `package.json`, `requirements.txt`).\n   2. Resolve dependencies.\n   3. Copy source.\n   4. Build.\n4. **User** — runtime stage runs as a non-root user with a fixed UID (e.g. `USER 65532:65532`). Distroless has `nonroot` baked in.\n5. **No secrets** in `ENV` or `ARG`. Use BuildKit secret mounts at build time; runtime secrets via your secret manager.\n6. **HEALTHCHECK** if the orchestrator doesn't supply one. Keep it cheap (\u003C 1s, no DB calls).\n7. **Labels** — `org.opencontainers.image.source`, `.version`, `.revision`. Lets the registry tie images back to a commit.\n\n## Output\n\n```dockerfile\n# syntax=docker\u002Fdockerfile:1.7\n\nFROM golang:1.22-alpine AS build\nWORKDIR \u002Fsrc\nCOPY go.mod go.sum .\u002F\nRUN --mount=type=cache,target=\u002Fgo\u002Fpkg\u002Fmod \\\n    --mount=type=cache,target=\u002Froot\u002F.cache\u002Fgo-build \\\n    go mod download\nCOPY . .\nRUN --mount=type=cache,target=\u002Froot\u002F.cache\u002Fgo-build \\\n    CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags=\"-s -w\" -o \u002Fout\u002Frefund .\u002Fcmd\u002Frefund\n\nFROM gcr.io\u002Fdistroless\u002Fstatic-debian12:nonroot\nWORKDIR \u002F\nCOPY --from=build \u002Fout\u002Frefund \u002Frefund\nUSER 65532:65532\nENTRYPOINT [\"\u002Frefund\"]\n\nLABEL org.opencontainers.image.source=\"https:\u002F\u002Fgithub.com\u002Fexample\u002Frefund-service\"\nLABEL org.opencontainers.image.version=\"0.1.0\"\n```\n\n## Quality bar\n\n- Runtime image \u003C 100 MB for a Go service; \u003C 200 MB for Node; \u003C 250 MB for Python-slim.\n- `USER` is set; not running as root.\n- No `apt-get install curl bash` \"just in case\".\n- `.dockerignore` excludes `.git`, `node_modules`, build outputs.\n\n## Anti-patterns to avoid\n\n- Single-stage build copying source + toolchain into prod image.\n- `FROM ubuntu:latest` for a Go binary.\n- `RUN apt-get update && apt-get install` without `--no-install-recommends` and cleanup.\n- Baking secrets via `ARG` (they remain in the image layer history).\n","# dockerize\n\n> Write a Dockerfile that's small, fast to rebuild, and safe to run.\n\n**Mode:** analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked `[TBD]` or `[VERIFY]`, never filled in.\n\n## When to use\n\n- A new service needs a container image.\n- An existing Dockerfile is bloated, slow, or runs as root.\n\n## Inputs\n\n- Language + framework.\n- Build artifact shape (compiled binary, JS bundle, Python module).\n- Runtime needs (does it need `bash`, `curl`, `ca-certificates`? Often: no.).\n\n## Project localization\n\nBefore the procedure, resolve the project snapshot —\n`${POLYMATH_DATA_DIR:-$HOME\u002F.polymath\u002Fdata}\u002Fpolymath-core\u002Fproject-context.json`\n(ignore it if its `_meta.source` belongs to another repo; absent → read\n`.polymath\u002Fproject.yaml` directly; neither → built-in defaults). Then apply\n(contract: `polymath-core:project-context`):\n\n- `conventions_docs`: read role `deployment` — approved base images,\n  registries, and hosting targets there override the generic choices\n  below.\n\n## Procedure\n\n1. **Multi-stage** always. Stage 1 builds; stage 2 runs.\n2. **Base images**:\n   - **Builder stage**: the official language image with the toolchain (e.g. `golang:1.22-alpine`, `node:20-alpine`, `python:3.12-slim`).\n   - **Runtime stage**: pick from smallest to most flexible:\n     - **`scratch`** — Go static binaries, Rust musl. Cheapest.\n     - **`gcr.io\u002Fdistroless\u002Fstatic`** \u002F `base` \u002F `cc` — no shell, no package manager. Recommended for compiled languages.\n     - **`-slim`** (debian-slim, python-slim) — for languages needing libc + a tiny userspace.\n     - **`-alpine`** — only if you've validated musl compatibility (Python wheels often don't).\n3. **Layer order** — most-cacheable first:\n   1. Copy dependency manifests (`go.mod`, `package.json`, `requirements.txt`).\n   2. Resolve dependencies.\n   3. Copy source.\n   4. Build.\n4. **User** — runtime stage runs as a non-root user with a fixed UID (e.g. `USER 65532:65532`). Distroless has `nonroot` baked in.\n5. **No secrets** in `ENV` or `ARG`. Use BuildKit secret mounts at build time; runtime secrets via your secret manager.\n6. **HEALTHCHECK** if the orchestrator doesn't supply one. Keep it cheap (\u003C 1s, no DB calls).\n7. **Labels** — `org.opencontainers.image.source`, `.version`, `.revision`. Lets the registry tie images back to a commit.\n\n## Output\n\n```dockerfile\n# syntax=docker\u002Fdockerfile:1.7\n\nFROM golang:1.22-alpine AS build\nWORKDIR \u002Fsrc\nCOPY go.mod go.sum .\u002F\nRUN --mount=type=cache,target=\u002Fgo\u002Fpkg\u002Fmod \\\n    --mount=type=cache,target=\u002Froot\u002F.cache\u002Fgo-build \\\n    go mod download\nCOPY . .\nRUN --mount=type=cache,target=\u002Froot\u002F.cache\u002Fgo-build \\\n    CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags=\"-s -w\" -o \u002Fout\u002Frefund .\u002Fcmd\u002Frefund\n\nFROM gcr.io\u002Fdistroless\u002Fstatic-debian12:nonroot\nWORKDIR \u002F\nCOPY --from=build \u002Fout\u002Frefund \u002Frefund\nUSER 65532:65532\nENTRYPOINT [\"\u002Frefund\"]\n\nLABEL org.opencontainers.image.source=\"https:\u002F\u002Fgithub.com\u002Fexample\u002Frefund-service\"\nLABEL org.opencontainers.image.version=\"0.1.0\"\n```\n\n## Quality bar\n\n- Runtime image \u003C 100 MB for a Go service; \u003C 200 MB for Node; \u003C 250 MB for Python-slim.\n- `USER` is set; not running as root.\n- No `apt-get install curl bash` \"just in case\".\n- `.dockerignore` excludes `.git`, `node_modules`, build outputs.\n\n## Anti-patterns to avoid\n\n- Single-stage build copying source + toolchain into prod image.\n- `FROM ubuntu:latest` for a Go binary.\n- `RUN apt-get update && apt-get install` without `--no-install-recommends` and cleanup.\n- Baking secrets via `ARG` (they remain in the image layer history).\n",{"name":5,"description":7},"main","23f6e21841a39580c9da2b5ec941f39dda17cd86","plugins\u002Fpolymath-devops\u002Fskills\u002Fdockerize","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath","https:\u002F\u002Fgithub.com\u002FMohammadBafkar","2026-10-29 18:34:59",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add MohammadBafkar\u002Fpolymath --skill dockerize",{"tool":36,"command":37},"bunx","bunx skills add MohammadBafkar\u002Fpolymath --skill dockerize",{"tool":39,"command":40},"pnpm","pnpm dlx skills add MohammadBafkar\u002Fpolymath --skill dockerize","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-devops\u002Fskills\u002Fdockerize\u002FSKILL.md",true,[44],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"routing.yaml","REFERENCE","参考文档",343,"https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-devops\u002Fskills\u002Fdockerize\u002Frouting.yaml",[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M74GN87EBRHM9N87M7AP1HDD","runbook","Write or refresh an operational runbook for an alert\u002Fsymptom; structured as TL;DR + Pre-checks + Steps + Verification + Rollback + Escalation.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Frunbook\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M74GN5GPKEC1JEKP2DFQNEQJ","rfc","Draft a lightweight design RFC to docs\u002Frfcs\u002F\u003Cslug>.md; Summary, Motivation, Detailed design, Drawbacks, Alternatives, Unresolved questions. A proposal to debate, not a recorded decision (adr).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Frfc\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M74GN2F4CWPMV4X09TG4E304","editorial-pass","Review and tighten prose in a Markdown artifact for a target tone (terse, formal, friendly) without dropping information; preserve quotations and load-bearing constraints.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Feditorial-pass\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M74GMZWGYMZ37C4DYGT6P23G","architecture-review-facilitation","Run an architecture review as a process — entry criteria, reviewer checklist, decision log, and follow-up actions — pairing the design artifact with a red-team pass.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Farchitecture-review-facilitation\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M74GMXVX0YX3ETDXS527XDGM","architecture-doc","Write a C4-style architecture document; System Context + Containers (+ Components when interesting) with mermaid diagrams. Describes structure, not a decision (adr) or proposal (rfc).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Farchitecture-doc\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M74GMVG1WSMCK066S3KE6V5K","adr","Write an Architecture Decision Record (Michael Nygard format) to docs\u002Fadrs\u002FNNNN-\u003Cslug>.md; frontmatter validated by the ADR artifact schema. Records a made decision, not a proposal to debate (rfc).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Fadr\u002FSKILL.md",[],[]]