Containers logo

Containers

Community
nimadorostkar
containers

Use when building or debugging container images. Covers multi-stage builds, layer caching, image size, non-root users, signal handling, and the security defaults most Dockerfiles get wrong. Trigger on "my docker image is 2gb", "container exits immediately", "container ignores sigterm". Do not use for pods, deployments, or cluster scheduling — see the kubernetes skill; for vulnerable dependencies and image provenance, see the supply-chain skill.

Overview

Publishernimadorostkar
RepositoryClaude-Skills-collection
Skill namecontainers
Stars
34
Forks
4
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by nimadorostkar on GitHub. Read the source before you install it.

Installation

Install the Containers AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/devops/containers
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection.git /tmp/Claude-Skills-collection
mkdir -p .claude/skills
cp -r /tmp/Claude-Skills-collection/skills/devops/containers .claude/skills/containers
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Containers in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Containers on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Containers is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Containers

Purpose

Build container images that are small, cached effectively, and safe to run — not a 1.2 GB image running as root that rebuilds from scratch every time a source file changes.

When to Use

  • Writing or reviewing a Dockerfile.
  • Reducing image size or build time.
  • Debugging a container that exits, hangs, or behaves differently from local development.
  • Hardening images before a security review.

Capabilities

  • Multi-stage builds and build-cache optimization.
  • Base-image selection: distroless, Alpine, slim, and their trade-offs.
  • Non-root users, read-only filesystems, and dropped capabilities.
  • Signal handling and PID 1 semantics.
  • Image scanning and SBOM generation.

Inputs

  • The application, its runtime, and its build steps.
  • The target platform (including whether ARM builds are required).
  • Security and compliance requirements.

Outputs

  • A multi-stage Dockerfile with an ordered, cache-friendly layer sequence.
  • An image running as a non-root user, with no build tooling inside.
  • A scan report with no critical vulnerabilities in the final image.

Workflow

  1. Order layers by change frequency — Dependency manifests first, dependency install second, source code last. Copying the source before installing dependencies invalidates the cache on every code change.
  2. Build in stages — A build stage with compilers and dev dependencies; a runtime stage containing only the artifact and its runtime. The compiler must not ship to production.
  3. Run as non-root — Create a user in the image and USER it. A container running as root that is compromised is a root process on the node.
  4. Handle signals — Use exec form (CMD ["node", "server.js"]), not shell form. Shell form makes /bin/sh PID 1, which does not forward SIGTERM, so your graceful shutdown never runs.
  5. Scan and pin — Pin the base image by digest, scan the final image, and rebuild regularly to pick up base-image patches.

Best Practices

  • COPY package*.json ./ then RUN npm ci then COPY . . — in that order. This is the single most impactful Dockerfile optimization and it is routinely written backwards.
  • Shell-form CMD means your process is not PID 1 and will not receive SIGTERM. Every "why doesn't my container shut down gracefully" question has this answer.
  • Distroless or scratch images have no shell, which is excellent for security and inconvenient for debugging. Use kubectl debug or a debug variant tag.
  • A .dockerignore that excludes .git, node_modules, and build output can cut the build context from hundreds of megabytes to a few.
  • latest is not a version. Pin by digest for reproducibility, or at minimum by an immutable tag.
  • Secrets passed as build args are baked into the image layers and recoverable. Use BuildKit secret mounts.

Examples

Multi-stage build with correct caching, a non-root user, and exec-form CMD:

dockerfile
# syntax=docker/dockerfile:1

# ---- build stage: has the toolchain, ships nothing ----
FROM node:22-bookworm-slim AS build
WORKDIR /app

COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm \
    npm ci                                   # cached unless the lockfile changes

COPY . .                                     # source last: code changes do not
RUN npm run build                            # invalidate the dependency layer

# ---- runtime stage: no compiler, no dev dependencies, no shell needed ----
FROM gcr.io/distroless/nodejs22-debian12@sha256:4c2e...
WORKDIR /app

COPY --from=build --chown=nonroot:nonroot /app/dist ./dist
COPY --from=build --chown=nonroot:nonroot /app/node_modules ./node_modules

USER nonroot                                 # never root
EXPOSE 8080
CMD ["dist/server.js"]                       # exec form: the process is PID 1

Secret at build time without baking it into a layer:

dockerfile
RUN --mount=type=secret,id=npm_token \
    NPM_TOKEN=$(cat /run/secrets/npm_token) npm ci

The token is available during the command and absent from the resulting layer. A ARG NPM_TOKEN would be permanently recoverable with docker history.

Notes

  • docker history <image> shows every layer and the command that created it. Anything a build arg touched is visible there — which is why build args are not a secrets mechanism.
  • Alpine uses musl instead of glibc. It is smaller, but it has caused real production bugs with DNS resolution and with native Node modules. slim variants are usually the safer default.
  • A read-only root filesystem (readOnlyRootFilesystem: true) with an explicit writable emptyDir for temp files eliminates an entire class of container escape and persistence techniques.

Frequently asked questions

What does the Containers AI skill do?

Use when building or debugging container images. Covers multi-stage builds, layer caching, image size, non-root users, signal handling, and the security defaults most Dockerfiles get wrong. Trigger on "my docker image is 2gb", "container exits immediately", "container ignores sigterm". Do not use for pods, deployments, or cluster scheduling — see the kubernetes skill; for vulnerable dependencies and image provenance, see the supply-chain skill.

Why use Containers on TypingMind?

Because you install it once and use it with any model. Containers is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Containers in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/devops/containers. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Containers?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Containers?

As many as you like. As long as a model supports skills, you can use Containers with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Containers AI skill free?

Yes. It is published on GitHub by nimadorostkar under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇