소스 정보
- 저장소
- tools-only/X-Skills
- 최근 소스 활동
- 2026년 2월 9일 04:08
- 감지된 SKILL.md 언어
- 영어
- 스타
- 7
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tools-only/X-Skills --skill dockerfile-generate명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
Index of Build Systems Skills
Coordination patterns for distributed dataflow systems including barriers, epochs, and distributed snapshots
Windowing, sessionization, time-series aggregation, and late data handling for streaming systems
SOC 직업 분류 기준
| name | dockerfile-generate |
| description | Generate optimized Dockerfile with multi-stage builds |
| shortcut | dg |
| category | devops |
| difficulty | beginner |
| estimated_time | 1 minute |
Automatically generates production-ready Dockerfiles with multi-stage builds, security hardening, and optimizations based on your project type.
/docker-compose-create instead)You are a Docker expert. When user runs /dockerfile-generate or /dg:
Detect project type:
# Check for language-specific files
package.json → Node.js
requirements.txt → Python
go.mod → Go
pom.xml → Java
Gemfile → Ruby
Cargo.toml → Rust
Ask key questions:
Generate optimized Dockerfile:
Create .dockerignore:
Provide build instructions:
# Dockerfile
[Complete optimized Dockerfile with comments]
# .dockerignore
[Complete file]
## Build Instructions
### Build:
```bash
docker build -t app-name:latest .
docker run -p 3000:3000 app-name:latest
docker images app-name:latest
## Examples
### Example 1: Node.js Express API
**User:** `/dg` (in Node.js project with package.json)
**Questions:**
- Entry point? → `src/index.js`
- Port? → `3000`
- Build step? → `Yes, TypeScript compilation`
- Health endpoint? → `/health`
**Output:**
```dockerfile
# Multi-stage Dockerfile for Node.js Express API
# Optimized for production: ~150MB final image
# Stage 1: Build environment
FROM node:20-alpine AS builder
WORKDIR /app
# Copy dependency files first (better caching)
COPY package*.json ./
# Install all dependencies (including dev deps for build)
RUN npm ci
# Copy source code
COPY . .
# Build TypeScript
RUN npm run build
# Stage 2: Production environment
FROM node:20-alpine AS production
# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --only=production && \
npm cache clean --force
# Copy built application from builder
COPY --from=builder --chown=nodejs:nodejs /app/dist ./dist
# Switch to non-root user
USER nodejs
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
# Start application
CMD ["node", "dist/index.js"]
# .dockerignore
node_modules
dist
build
npm-debug.log
.env
.env.local
.git
.gitignore
*.md
.vscode
.idea
.DS_Store
coverage
.nyc_output
User: /dg (in Python project with requirements.txt)
Questions:
app.py8000No/api/healthOutput:
# Optimized Dockerfile for Python Flask API
# Production-ready: ~120MB final image
FROM python:3.11-slim AS production
# Prevent Python from buffering stdout/stderr
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# Create non-root user
RUN groupadd -g 1001 appuser && \
useradd -r -u 1001 -g appuser appuser
WORKDIR /app
# Install system dependencies (if needed)
# RUN apt-get update && apt-get install -y --no-install-recommends \
# gcc \
# && rm -rf /var/lib/apt/lists/*
# Copy requirements first (better caching)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY --chown=appuser:appuser . .
# Switch to non-root user
USER appuser
# Expose port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health').read()"
# Start application
CMD ["python", "app.py"]
# .dockerignore
__pycache__
*.pyc
*.pyo
*.pyd
.Python
env
venv
.venv
.env
.git
.gitignore
*.md
.vscode
.pytest_cache
.coverage
htmlcov
User: /dg (in Go project with go.mod)
Questions:
cmd/api/main.go8080Yes, Go compilation/healthOutput:
# Multi-stage Dockerfile for Go API
# Produces tiny static binary: ~10-15MB
# Stage 1: Build environment
FROM golang:1.21-alpine AS builder
WORKDIR /app
# Copy go mod files first (better caching)
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build static binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o api ./cmd/api
# Stage 2: Minimal runtime
FROM alpine:latest
# Install ca-certificates for HTTPS
RUN apk --no-cache add ca-certificates
# Create non-root user
RUN addgroup -g 1001 -S appuser && \
adduser -S appuser -u 1001 -G appuser
WORKDIR /app
# Copy binary from builder
COPY --from=builder --chown=appuser:appuser /app/api .
# Switch to non-root user
USER appuser
# Expose port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
# Start application
CMD ["./api"]
# .dockerignore
.git
.gitignore
*.md
.vscode
.idea
vendor
*.exe
*.exe~
*.dll
*.so
*.dylib
*.test
*.out
Multi-stage builds reduce size by 80-90% Always use .dockerignore (faster builds) Non-root user is critical for security Health checks enable container orchestration Use specific version tags (not :latest)
Issue: Build fails at npm install
→ Ensure package-lock.json is present (use npm ci not npm install)
Issue: Image is still large (>500MB) → Check for unnecessary files in .dockerignore → Verify using alpine/slim base image → Ensure dev dependencies excluded in production stage
Issue: Permission denied errors
→ Make sure files are chowned to non-root user in COPY commands
→ Example: COPY --chown=nodejs:nodejs
Issue: Health check failing → Verify health endpoint is accessible inside container → Check port mapping is correct → Ensure application starts before first health check (use --start-period)