docker-volumes
Implement persistent storage with Docker volumes, bind mounts, and backup strategies
What this skill does
# Docker Volumes Skill
Master Docker persistent storage including named volumes, bind mounts, tmpfs, and data backup/restore procedures.
## Purpose
Implement reliable data persistence for containers with proper volume management, backup strategies, and permission handling.
## Parameters
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| volume_name | string | No | - | Name for the volume |
| mount_type | enum | No | volume | volume/bind/tmpfs |
| backup | boolean | No | false | Include backup commands |
## Storage Types
| Type | Persistence | Use Case | Managed By |
|------|-------------|----------|------------|
| Named Volume | Yes | Production data | Docker |
| Bind Mount | Yes | Development, configs | Host |
| tmpfs | No (memory) | Secrets, temp files | Docker |
| Anonymous | Container lifetime | Scratch space | Docker |
## Volume Operations
### Named Volumes
```bash
# Create volume
docker volume create app_data
# Use in container
docker run -d \
-v app_data:/var/lib/postgresql/data \
postgres:16-alpine
# Inspect volume
docker volume inspect app_data
# List volumes
docker volume ls
# Remove unused volumes
docker volume prune
```
### Bind Mounts
```bash
# Development - mount source code
docker run -d \
-v $(pwd)/src:/app/src \
node:20-alpine
# Read-only config
docker run -d \
-v /etc/app/config.yaml:/app/config.yaml:ro \
myapp
```
### tmpfs Mounts
```bash
# Sensitive data in memory
docker run -d \
--tmpfs /app/secrets:rw,noexec,nosuid,size=64m \
myapp
# Compose syntax
services:
app:
volumes:
- type: tmpfs
target: /app/tmp
tmpfs:
size: 100m
```
## Docker Compose Volumes
```yaml
services:
database:
image: postgres:16-alpine
volumes:
- db_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
app:
image: myapp
volumes:
- uploads:/app/uploads
- ./config:/app/config:ro
volumes:
db_data:
driver: local
uploads:
external: true # Pre-created
```
## Backup & Restore
### Backup Volume
```bash
# Backup to tar file
docker run --rm \
-v app_data:/source:ro \
-v $(pwd)/backups:/backup \
alpine tar cvf /backup/app_data_$(date +%Y%m%d).tar -C /source .
# Compressed backup
docker run --rm \
-v app_data:/source:ro \
-v $(pwd)/backups:/backup \
alpine tar czvf /backup/app_data_$(date +%Y%m%d).tar.gz -C /source .
```
### Restore Volume
```bash
# Restore from tar
docker run --rm \
-v app_data:/dest \
-v $(pwd)/backups:/backup:ro \
alpine tar xvf /backup/app_data_20240101.tar -C /dest
```
### Clone Volume
```bash
docker run --rm \
-v source_volume:/from:ro \
-v target_volume:/to \
alpine cp -av /from/. /to/
```
## Error Handling
### Common Errors
| Error | Cause | Solution |
|-------|-------|----------|
| `volume in use` | Container running | Stop container first |
| `permission denied` | UID mismatch | Fix ownership |
| `no space left` | Disk full | Clean up or expand |
| `path not found` | Bind mount missing | Create directory |
### Permission Fixes
```bash
# Check ownership
docker run --rm -v app_data:/data alpine ls -la /data
# Fix ownership (match container user)
docker run --rm -v app_data:/data alpine chown -R 1000:1000 /data
# SELinux (RHEL/CentOS)
docker run -v /host/path:/container/path:Z myimage
```
## Troubleshooting
### Debug Checklist
- [ ] Volume exists? `docker volume ls`
- [ ] Mount visible? `docker exec <c> df -h`
- [ ] Permissions correct? `ls -la` in container
- [ ] Data persisting? Stop/start container
### Diagnostic Commands
```bash
# Check volume location
docker volume inspect app_data --format '{{.Mountpoint}}'
# Check container mounts
docker inspect <container> --format '{{json .Mounts}}'
# Check disk usage
docker system df -v
```
## Usage
```
Skill("docker-volumes")
```
## Related Skills
- docker-compose-setup
- docker-production
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.