docker-build
Generates and optimizes Dockerfiles for project containerization.
Install
mkdir -p .claude/skills/docker-build && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16237" && unzip -o skill.zip -d .claude/skills/docker-build && rm skill.zipInstalls to .claude/skills/docker-build
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Creates or optimizes a Dockerfile for the current projectKey capabilities
- →Detect project type for Dockerfile generation
- →Review existing Dockerfiles for best practices
- →Generate new Dockerfiles following multi-stage build patterns
- →Create or update `.dockerignore` files
- →Show `docker build` and `docker run` commands
- →Optimize image size
How it works
The skill detects the project type, reviews existing Dockerfiles for best practices, or generates a new multi-stage Dockerfile and a `.dockerignore` file, then provides build and run commands.
Inputs & outputs
When to use docker-build
- →Creating new Dockerfiles
- →Optimizing container build stages
- →Configuring .dockerignore
About this skill
Docker Setup
- Detect project type:
cat package.json 2>/dev/null | grep '"main"\|"start"\|"scripts"' -A 5
ls -la | grep -E "Dockerfile|docker-compose|\.dockerignore"
-
If Dockerfile exists, review it for:
- Multi-stage build (build stage vs runtime stage)
- Layer caching order (dependencies before source)
- Running as non-root user
.dockerignorecompleteness- Image size optimization
-
If no Dockerfile, generate one following best practices:
# Multi-stage: build → runtime
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
FROM node:20-alpine AS runtime
RUN addgroup -S app && adduser -S app -G app
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY . .
USER app
EXPOSE 3000
CMD ["node", "dist/index.js"]
- Also create/update
.dockerignore:
node_modules
dist
.env*
.git
coverage
*.test.*
- Show
docker buildanddocker runcommands to test.
When not to use it
- →When the user does not want a multi-stage build
- →When the user does not want a non-root user in the container
- →When the user does not want to optimize image size
Limitations
- →Assumes common project structures for detection.
- →Generated Dockerfiles follow specific multi-stage patterns.
- →`.dockerignore` content is based on common exclusions.
How it compares
This skill automates the creation and optimization of Dockerfiles and `.dockerignore` files based on project type and best practices, which is more efficient than manual configuration.
Compared to similar skills
docker-build side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| docker-build (this skill) | 0 | 4mo | Review | Beginner |
| docker-expert | 11 | 6mo | Review | Intermediate |
| deployment-engineer | 4 | 4mo | No flags | Advanced |
| devops | 2 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
docker-expert
davila7
Docker containerization expert with deep knowledge of multi-stage builds, image optimization, container security, Docker Compose orchestration, and production deployment patterns. Use PROACTIVELY for Dockerfile optimization, container issues, image size problems, security hardening, networking, and orchestration challenges.
deployment-engineer
sickn33
Expert deployment engineer specializing in modern CI/CD pipelines, GitOps workflows, and advanced deployment automation. Masters GitHub Actions, ArgoCD/Flux, progressive delivery, container security, and platform engineering. Handles zero-downtime deployments, security scanning, and developer experience optimization. Use PROACTIVELY for CI/CD design, GitOps implementation, or deployment automation.
devops
mrgoonie
Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.
ecs
itsmostafa
AWS ECS container orchestration for running Docker containers. Use when deploying containerized applications, configuring task definitions, setting up services, managing clusters, or troubleshooting container issues.
add-install-docker-ci-e2e
RLinf
Adds install command in install script, Docker build stage in Dockerfile, and CI jobs for docker build, install script, and embodied e2e test when introducing a new model or environment in RLinf. Use when adding a new embodied model (e.g. dexbotic), new env (e.g. maniskill_libero), or new model+env combination that should be installable, dockerized, and tested in CI.
devcontainer-management
netalertx
Guide for identifying, managing, and running commands within the NetAlertX development container. Use this when asked to run commands, testing, setup scripts, or troubleshoot container issues.