Skip to content
Skills Library
DevOps & cloud · Building & coding

dockerfile-patterns

/dockerfile-patterns

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++.

Repository
rse-plugins ↗
Licence
BSD-3-Clause
Last repository change
14.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
9
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 14.10.2026, without references to retired models or APIs.

Licence

BSD-3-Clause, otwarta.

What it does and when to use it

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++.

Original author description

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 it works

  1. Primary Actions
  2. Quick Build Pattern
  3. Validation Workflow
  4. Language Templates
  5. Deep References
Original SKILL.md headings · 55 lines, 186 words
SKILL.md preview
---
name: dockerfile-patterns
description: 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++.
metadata:
  references:
    - references/multi-stage-builds.md
    - references/layer-caching.md
    - references/base-image-selection.md
    - references/build-validation-and-ops.md
  assets:
    - assets/python-dockerfile.dockerfile
    - assets/node-dockerfile.dockerfile
    - assets/rust-dockerfile.dockerfile
    - assets/r-dockerfile.dockerfile
---

# 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

```dockerfile
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

- [assets/python-dockerfile.dockerfile](assets/python-dockerfile.dockerfile)
- [assets/node-dockerfile.dockerfile](assets/node-dockerfile.dockerfile)
- [assets/rust-dockerfile.dockerfile](assets/rust-dockerfile.dockerfile)
- [assets/r-dockerfile.dockerfile](assets/r-dockerfile.dockerfile)

## Deep References

- Multi-stage design patterns:
  [references/multi-stage-builds.md](references/multi-stage-builds.md)
- Layer caching patterns and cache debugging:
  [references/layer-caching.md](references/layer-caching.md)
- Base image selection decision guidance:
  [references/base-image-selection.md](references/base-image-selection.md)
- Validation gates, `.dockerignore`, security defaults, and common failure patterns:
  [references/build-validation-and-ops.md](references/build-validation-and-ops.md)
Files in this package (9)
  • SKILL.md 3 KB
  • assets/node-dockerfile.dockerfile 4 KB
  • assets/python-dockerfile.dockerfile 5 KB
  • assets/r-dockerfile.dockerfile 4 KB
  • assets/rust-dockerfile.dockerfile 4 KB
  • references/base-image-selection.md 13 KB
  • references/build-validation-and-ops.md 1 KB
  • references/layer-caching.md 13 KB
  • references/multi-stage-builds.md 17 KB

Versions

The database has no other skills named dockerfile-patterns.

Database snapshot: 13.11.2026 · package version 8b4637f93c93 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100docker
    Expert Docker containerization assistance covering multi-stage Dockerfiles, Docker Compose, layer caching, and container security. Use when containerizing applications, creating reproducible environments, or optimizing images.
  • 100docker-multi-stage-builds
    Master production Docker multi-stage builds, container image layer caching, security hardening, non-root user execution, distroless images, and minimal footprint optimizations. Trigger when building Dockerfiles, optimizing image size, or hardening container runtime security.
  • 100docker-development
    Docker and container development agent skill and plugin for Dockerfile optimization, docker-compose orchestration, multi-stage builds, and container security hardening. Use when: user wants to optimize a Dockerfile, create or improve docker-compose configurations, implement…
  • 95docker-patterns
    Use this skill when the user says 'Dockerfile', 'Docker', 'Docker Compose', 'containerize', 'container', 'docker build', 'multi-stage build', 'docker-compose.yml', or when containerizing an application. Covers: multi-stage builds, non-root users, .dockerignore, layer caching,…
  • 100docker
    Docker containerization. Covers Dockerfile, images, and best practices. Use for containerizing applications. USE WHEN: user mentions "dockerfile", "docker build", "docker run", "containerize", "docker image", "multi-stage build", asks about "how to dockerize", "container…
  • 100docker-deploy
    Use when creating Dockerfiles, docker-compose configs, or containerizing applications. Covers multi-stage builds, image optimization, compose patterns for dev and production, health checks, signal handling, and security hardening.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.