Skip to content
Back to skills

Devops

ASecurity

Docker containerization skill - Images, Compose, security, optimization

  • 3 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
devopsshellbashsqlnodedockersecurity

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add pluginagentmarketplace/custom-plugin-linux --skill devops --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Devops?

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

Security grade badge for Devops
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pluginagentmarketplace-devops-e50f530e/badge)](https://www.skillsdirectory.com/skills/pluginagentmarketplace-devops-e50f530e)

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
description: Docker containerization skill - Images, Compose, security, optimization
version: "1.0.0"
sasmp_version: "1.3.0"

input_schema:
  type: object
  properties:
    task: { type: string, enum: [build, debug, optimize, security, compose] }
    base_image: { type: string }
  required: [task]

output_schema:
  type: object
  properties:
    dockerfile: { type: string }
    commands: { type: array }
    security_notes: { type: array }

retry_config:
  max_attempts: 3
  backoff: exponential

timeout_ms: 60000
---

# Docker Skill

## PURPOSE
Container image building, optimization, and orchestration.

## CORE COMPETENCIES
```
Dockerfile:
├── Multi-stage builds
├── Layer caching
├── Build arguments
└── Health checks

Docker Compose:
├── Service definition
├── Networks
├── Volumes
└── Environment management

Security:
├── Non-root users
├── Minimal base images
├── Secret management
└── Image scanning
```

## CODE PATTERNS

### Multi-Stage Build
```dockerfile
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build

# Production stage
FROM node:20-alpine
RUN addgroup -g 1001 app && adduser -u 1001 -G app -s /bin/sh -D app
USER app
WORKDIR /app
COPY --from=builder --chown=app:app /app/dist ./dist
COPY --from=builder --chown=app:app /app/node_modules ./node_modules
EXPOSE 3000
HEALTHCHECK --interval=30s CMD wget -q --spider http://localhost:3000/health
CMD ["node", "dist/main.js"]
```

### Docker Compose
```yaml
version: '3.8'
services:
  app:
    build: .
    ports: ["3000:3000"]
    environment:
      - NODE_ENV=production
    depends_on:
      db:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/health"]
      interval: 30s
      retries: 3

  db:
    image: postgres:16-alpine
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]

volumes:
  pgdata:
```

## TROUBLESHOOTING

| Issue | Cause | Solution |
|-------|-------|----------|
| Build slow | No cache | Order layers by change frequency |
| Image large | Too many layers | Use multi-stage, alpine |
| Container exits | App crash | Check logs, add health check |
| Permission denied | Root vs user | Use non-root user |

## COMMANDS
```bash
# Build
docker build -t app:latest .

# Run with limits
docker run -d --memory=512m --cpus=1 app:latest

# Debug
docker logs -f container_id
docker exec -it container_id sh

# Cleanup
docker system prune -af
```

Files in this skill

  • SKILL.md702 B
  • assets/config.yaml669 B
  • assets/schema.json1.1 KB
  • cloud-SKILL.md2.5 KB
  • docker-SKILL.md2.6 KB
  • kubernetes-SKILL.md3.4 KB
  • references/GUIDE.md1.8 KB
  • references/PATTERNS.md1.5 KB
  • scripts/validate.py3.7 KB
  • terraform-SKILL.md2.3 KB

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.

View all in devops →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.