Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

dockerfile-patterns

FreeNo executable scriptsNot checked

Use when the user asks about writing, optimizing, or debugging Dockerfiles, containerizing applications, or building Docker images with docker build. Covers…

uw-ssecby uw-ssec★ 33 GitHub stars

About this skill

Dockerfile Patterns

Primary Actions

  • Create production-ready Dockerfiles for common language stacks.
  • Reduce image size with multi-stage build separation.
  • Improve build speed with layer-cache-friendly ordering.
  • Apply baseline security hardening defaults.
  • Choose fit-for-purpose base images for runtime constraints.

Quick Build Pattern

FROM python:3.11 AS builder
WORKDIR /app
COPY requirements.txt .
RUN pip install --prefix=/install -r requirements.txt
COPY . .

FROM python:3.11-slim
WORKDIR /app
COPY --from=builder /install /usr/local
COPY --from=builder /app /app
RUN useradd -u 1001 -m appuser
USER 1001
ENTRYPOINT ["python", "-m", "myapp"]

Validation Workflow

  1. Build the image (docker build).
  2. Run startup check (docker run --rm <image> --help or equivalent).
  3. For services, run a smoke check with expected command/port.
  4. Run vulnerability scan before release (trivy image or docker scout cves).
  5. If validation fails, revise Dockerfile and rebuild.

Language Templates

Deep References

Install dockerfile-patterns in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

assets/node-dockerfile.dockerfileassets/python-dockerfile.dockerfileassets/r-dockerfile.dockerfileassets/rust-dockerfile.dockerfilereferences/base-image-selection.mdreferences/build-validation-and-ops.mdreferences/layer-caching.mdreferences/multi-stage-builds.md

FAQ

What does the dockerfile-patterns skill do?

Use when the user asks about writing, optimizing, or debugging Dockerfiles, containerizing applications, or building Docker images with docker build. Covers multi-stage builds, layer caching, base image selection, security hardening, and language-specific patterns for Python, Node, Rust, R, Go, Julia, and C/C++.

How do I install the dockerfile-patterns skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the dockerfile-patterns skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare dockerfile-patterns with