Skip to content
Back to skills

Docker Build

ASecurity

Creates or optimizes a Dockerfile for the current project

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 1, 2026
ai-agentsbashnodedockergit

Security analysis

A100/100

Scanned June 1, 2026

npx -y skills add berkcangumusisik/claude-code-practices --skill docker-build --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docker Build?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docker Build
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/berkcangumusisik-docker-build/badge)](https://www.skillsdirectory.com/skills/berkcangumusisik-docker-build)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: docker-build
description: Creates or optimizes a Dockerfile for the current project
user-invocable: true
allowed-tools: Read Glob Bash Edit
effort: medium
---

## Docker Setup

1. Detect project type:
```bash
cat package.json 2>/dev/null | grep '"main"\|"start"\|"scripts"' -A 5
ls -la | grep -E "Dockerfile|docker-compose|\.dockerignore"
```

2. 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
   - `.dockerignore` completeness
   - Image size optimization

3. If no Dockerfile, generate one following best practices:

```dockerfile
# 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"]
```

4. Also create/update `.dockerignore`:
```
node_modules
dist
.env*
.git
coverage
*.test.*
```

5. Show `docker build` and `docker run` commands to test.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…