containerize
Skill10 starsChanged 56 days agoMITView on GitHub
Build, scan, sign, and verify Python container images with Trivy and Cosign.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- pvnarp/agent-skillstheir own version, first seen Mar 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- aprameyak/coding-skills★ 1same name
- pvnarp/agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository101 other files it gives its agents.
- AGENTS.mdAGENTS.md
- dot_agents/AGENTS.mdAGENTS.md
- skills/agent-project/templates/AGENTS.mdAGENTS.md
- skills/repository-docs/references/agents.mdAGENTS.md
- chezmoiSkill
- dot-developmentSkill
- dot-releaseSkill
- dot-skillsSkill
- dot-verifySkill
- acliSkill
- agent-evaluationSkill
- agent-frameworksSkill
- agent-harnessesSkill
- agent-loopsSkill
- agent-projectSkill
- agent-protocolsSkill
- agent-usageSkill
- agySkill
- airflowSkill
- ai-security-assessmentSkill
- api-clientSkill
- ast-grepSkill
- auth-statusSkill
- awsSkill
- benchmarkSkill
- bfSkill
- chrome-devtoolsSkill
- cli-developmentSkill
- clipboardSkill
- cloud-runSkill
- code-securitySkill
- colabSkill
- course-developmentSkill
- databricksSkill
- data-migrationSkill
- delegate-tasksSkill
- diagrams-as-codeSkill
- dockerSkill
- documentation-siteSkill
- dot-cliSkill
- dprintSkill
- draft-mailSkill
- duckdbSkill
- fact-checkSkill
- fmind-visualsSkill
- full-reviewSkill
- gcloudSkill
- ghSkill
- git-deliverySkill
- github-actionsSkill
- github-issuesSkill
- github-pull-requestSkill
- github-repositorySkill
- git-worktreeSkill
- google-developerSkill
- gwsSkill
- handoffSkill
- hfSkill
- implementation-planSkill
- incident-responseSkill
- The first 60 shown.
The file
Files
Containerize
Build a reproducible, minimal non-root uv-managed Python image locally, verify its immutable digest, and publish only within the user's authorized registry scope. cloud-run deploys it, trivy scans it, and the cosign guide below owns provenance; read it only when publication or verification requires signing.
Workflow
- Budget and identify resources: inspect free space on the workspace and Docker storage filesystems, the selected Docker context,
docker system df, anddocker buildx ls. Rundot doctor --headroomfirst, then confirm the projected peak (context, layers, archive export and extraction) still leaves 20 GiB free, per resource cleanup. Record task-owned names/IDs before creating resources; use a unique Compose project or resource label so concurrent work stays separate. - Adopt the templates: copy Dockerfile and .dockerignore. Replace
<slug>with the installed Python console script and verify both image digests before use. Build locally: emit a Docker archive so the first build and scan require no registry mutation.
mkdir -p tmp docker buildx build --output type=docker,dest=tmp/image.tar .Wire the gate into
mise.toml;check:imagescans the exact archive produced bybuild:image.[tasks."build:image"] description = "Build the Python OCI image locally" run = ["mkdir -p tmp", "docker buildx build --output type=docker,dest=tmp/image.tar ."] [tasks."check:image"] description = "Scan the local OCI image" depends = ["build:image"] run = "trivy --config trivy.yaml image --skip-dirs '' --input tmp/image.tar"- Exercise the container: load it with
docker load --input tmp/image.tar. For the Python web starter, supply required application settings through a reviewed local environment file, then rundocker run --rm -p 127.0.0.1:8080:8080 --env-file <runtime-env-file> -e HOST=0.0.0.0 -e PORT=8080 -e ENVIRONMENT=production <local-reference>and request/healthand/ready. For a CLI image, exercise its actual command and exit behavior instead of publishing a port. - Publish when authorized: push a reviewed tag with
docker buildx build --push --tag "$IMAGE_REPOSITORY:$TAG" --metadata-file tmp/image-metadata.json .. Parsecontainerimage.digestfrom that file, requiresha256:plus 64 lowercase hex characters, and record$IMAGE_REPOSITORY@$DIGEST. - Verify the immutable result: scan the recorded digest, generate a CycloneDX SBOM, sign it, pin the expected certificate identity and issuer during verification, and attest the SBOM per trivy and cosign. For a multi-platform index, scan every child and bind each SBOM to that child's digest before promoting the index; the CD template implements this sequence.
- Tear down temporary resources on success and failure, preserving requested deliverables and useful failure evidence. Follow resource cleanup, verify only recorded task resources disappeared, and report any retained disk footprint and reason.
Gotchas
- Fail on lock drift with
--locked:uv sync --lockedrejects a missing or staleuv.lock;--frozenskips freshness checks. The template uses--lockedso manifest drift fails without rewriting the graph. - Run non-root with explicit writable paths: the template runs as numeric UID/GID 10001 and copies only the locked virtual environment from the build stage. Write temporary data outside the application directory or mount an explicit writable path.
- Refresh pinned bases together: both Python and uv use multi-architecture manifest digests. Refresh versions and digests together with upgrade-tools.
- Exclude local state from the context: keep virtual environments, caches, logs, local databases, Git state, plaintext environment files, and generated
gha-creds-*.jsonWorkload Identity Federation credentials out through .dockerignore. The Cloud Run authentication action creates its credential file before the Docker build; it must not enter a build layer. - Digests over tags: scans, signatures, attestations, deployment, and rollback all use the same immutable digest reference.
- Authorize every registry write: pushes, signatures, and attestations require explicit authority; local build and scan do not grant it.
- Reuse shared build cache under budget:
--rmremoves a container, not its image, exported archive or build cache. Shared builder cache has no reliable per-agent ownership; reuse it under a reviewed storage budget instead of pruning it at every task end.
Task guides
<!-- guides:start -->- cosign: Image signatures, identity verification, and attestations.
<!-- guides:end -->Documentation
- Docker multi-stage builds · uv Docker guide
- Resource cleanup · Build cache garbage collection
- Releases: Docker Engine · uv changelog
- Companion skills: python-stack, cloud-run, trivy, github-actions, and code-security.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

