[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EEV9MPWHFC81MQEGDWWJP0":3,"skill-same:01M6EEV9MPWHFC81MQEGDWWJP0":88},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":27,"frontMatter":28,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M6EEV9MPWHFC81MQEGDWWJP0","docker-helper",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fdocker-helper\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[23,24],"docker","docker helper","2026-11-10 10:12:30",false,"# Docker Helper\n\n## Overview\n\nCreate, debug, and optimize Docker configurations including Dockerfiles, docker-compose setups, and container troubleshooting. Follows Docker best practices for security, image size, and build speed.\n\n## Instructions\n\nWhen a user asks for help with Docker, determine which task they need:\n\n### Task A: Create a Dockerfile\n\n1. Identify the application language and framework\n2. Choose the right base image (prefer `-slim` or `-alpine` variants)\n3. Use multi-stage builds for compiled languages\n4. Follow this ordering for optimal layer caching:\n\n```dockerfile\n# Stage 1: Build\nFROM node:20-alpine AS builder\nWORKDIR \u002Fapp\nCOPY package*.json .\u002F\nRUN npm ci --only=production\nCOPY . .\nRUN npm run build\n\n# Stage 2: Runtime\nFROM node:20-alpine\nWORKDIR \u002Fapp\nRUN addgroup -g 1001 appgroup && adduser -u 1001 -G appgroup -D appuser\nCOPY --from=builder \u002Fapp\u002Fdist .\u002Fdist\nCOPY --from=builder \u002Fapp\u002Fnode_modules .\u002Fnode_modules\nCOPY --from=builder \u002Fapp\u002Fpackage.json .\u002F\nUSER appuser\nEXPOSE 3000\nCMD [\"node\", \"dist\u002Findex.js\"]\n```\n\n**Key rules:**\n- Copy dependency files first, then source (caching)\n- Run as non-root user\n- Use `.dockerignore` to exclude `node_modules`, `.git`, `.env`\n- Pin base image versions (e.g., `node:20.11-alpine`, not `node:latest`)\n- Combine RUN commands to reduce layers\n\n### Task B: Write docker-compose.yml\n\n```yaml\nversion: \"3.8\"\n\nservices:\n  app:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    ports:\n      - \"3000:3000\"\n    environment:\n      - DATABASE_URL=postgres:\u002F\u002Fuser:pass@db:5432\u002Fmyapp\n    depends_on:\n      db:\n        condition: service_healthy\n    restart: unless-stopped\n\n  db:\n    image: postgres:16-alpine\n    volumes:\n      - pgdata:\u002Fvar\u002Flib\u002Fpostgresql\u002Fdata\n    environment:\n      POSTGRES_USER: user\n      POSTGRES_PASSWORD: pass\n      POSTGRES_DB: myapp\n    healthcheck:\n      test: [\"CMD-SHELL\", \"pg_isready -U user -d myapp\"]\n      interval: 5s\n      timeout: 5s\n      retries: 5\n\nvolumes:\n  pgdata:\n```\n\n**Key rules:**\n- Use `depends_on` with health checks, not just service names\n- Use named volumes for persistent data\n- Never hardcode secrets in compose files for production (use env files or secrets)\n- Set restart policies\n\n### Task C: Debug container issues\n\nFollow this diagnostic sequence:\n\n```bash\n# 1. Check container status\ndocker ps -a\n\n# 2. Read container logs\ndocker logs \u003Ccontainer> --tail 50\n\n# 3. Inspect container details\ndocker inspect \u003Ccontainer> | jq '.[0].State'\n\n# 4. Check resource usage\ndocker stats --no-stream\n\n# 5. Get a shell inside the container\ndocker exec -it \u003Ccontainer> \u002Fbin\u002Fsh\n\n# 6. Check networking\ndocker network ls\ndocker network inspect \u003Cnetwork>\n```\n\nCommon issues and fixes:\n- **Container exits immediately**: Check logs; usually a missing env var or config file\n- **Port already in use**: `lsof -i :PORT` to find the conflict\n- **Cannot connect between containers**: Ensure they are on the same Docker network and use service names as hostnames\n- **Out of disk space**: `docker system prune -a` to clean up unused images and containers\n- **Build fails at COPY**: Check `.dockerignore` and verify paths are relative to build context\n\n### Task D: Optimize image size\n\n```bash\n# Check current image size\ndocker images | grep myapp\n\n# Analyze layers\ndocker history myapp:latest\n```\n\nOptimization checklist:\n1. Switch to alpine base images\n2. Use multi-stage builds (build deps stay in builder stage)\n3. Combine RUN commands with `&&`\n4. Remove package manager caches: `rm -rf \u002Fvar\u002Fcache\u002Fapk\u002F*`\n5. Use `.dockerignore` to exclude test files, docs, .git\n6. Do not install dev dependencies in the final image\n\n## Examples\n\n### Example 1: Create a Dockerfile for a Python FastAPI app\n\n**User request:** \"Create a Dockerfile for my FastAPI project\"\n\n**Output Dockerfile:**\n```dockerfile\nFROM python:3.12-slim AS builder\nWORKDIR \u002Fapp\nCOPY requirements.txt .\nRUN pip install --no-cache-dir --prefix=\u002Finstall -r requirements.txt\n\nFROM python:3.12-slim\nWORKDIR \u002Fapp\nRUN useradd -r -s \u002Fbin\u002Ffalse appuser\nCOPY --from=builder \u002Finstall \u002Fusr\u002Flocal\nCOPY . .\nUSER appuser\nEXPOSE 8000\nCMD [\"uvicorn\", \"main:app\", \"--host\", \"0.0.0.0\", \"--port\", \"8000\"]\n```\n\n**Output .dockerignore:**\n```\n__pycache__\n*.pyc\n.git\n.env\n.venv\ntests\u002F\n*.md\n```\n\n**Result:** Image size ~180MB instead of ~1.2GB with the full Python image.\n\n### Example 2: Debug a container that keeps restarting\n\n**User request:** \"My web container keeps restarting, can you help?\"\n\n**Diagnostic steps:**\n```\n$ docker ps -a\nCONTAINER ID  IMAGE    STATUS                     NAMES\na1b2c3d4e5f6  web:1.0  Restarting (1) 5 sec ago   web\n\n$ docker logs web --tail 20\nError: ECONNREFUSED 127.0.0.1:5432\n    at TCPConnectWrap.afterConnect\n\nRoot cause: The app is trying to connect to PostgreSQL at 127.0.0.1,\nbut in Docker the database is a separate container.\n\nFix: Change DATABASE_URL from localhost to the service name:\n  DATABASE_URL=postgres:\u002F\u002Fuser:pass@db:5432\u002Fmyapp\n                                     ^^ service name, not localhost\n```\n\n## Guidelines\n\n- Always create a `.dockerignore` alongside any Dockerfile.\n- Pin base image versions to specific tags, not `latest`.\n- Never store secrets in Docker images or Dockerfiles. Use environment variables or Docker secrets.\n- For production, always run as a non-root user.\n- When optimizing, measure before and after with `docker images`.\n- If a build is slow, check layer ordering. Dependencies (package.json, requirements.txt) should be copied and installed before source code.\n- For local development, use bind mounts for live reloading. For production, use COPY.\n- Health checks should test actual application readiness, not just process existence.\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fdocker-helper",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill docker-helper",{"tool":44,"command":45},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill docker-helper",{"tool":47,"command":48},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill docker-helper","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fdocker-helper\u002FSKILL.md",true,[52,58,62,66,70,74,78,82],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"BENCHMARK.md","REFERENCE","参考文档",4038,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-run-automl-deft-pipeline\u002FBENCHMARK.md",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"evals\u002Fevals.json",819,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-run-automl-deft-pipeline\u002Fevals\u002Fevals.json",{"path":63,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fconsolidated-preflight.md",6708,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-run-automl-deft-pipeline\u002Freferences\u002Fconsolidated-preflight.md",{"path":67,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fphase-handoffs.md",8080,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-run-automl-deft-pipeline\u002Freferences\u002Fphase-handoffs.md",{"path":71,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fpitfalls-and-quality-checks.md",2586,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-run-automl-deft-pipeline\u002Freferences\u002Fpitfalls-and-quality-checks.md",{"path":75,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fquick-start-example.md",2910,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-run-automl-deft-pipeline\u002Freferences\u002Fquick-start-example.md",{"path":79,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":80,"sourceHtmlUrl":81},"skill-card.md",4049,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-run-automl-deft-pipeline\u002Fskill-card.md",{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"skill.oms.sig","OTHER","其他",5605,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Ftao-run-automl-deft-pipeline\u002Fskill.oms.sig",[89,101,111,120,126,133],{"skillNo":90,"name":91,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":97,"publishedAt":25},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[94],{"categoryNo":95,"categoryName":96,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[98,99,100],"model","model hierarchy","model hierarchy skill",{"skillNo":102,"name":103,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":107,"publishedAt":25},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[106],{"categoryNo":95,"categoryName":96,"taxonomyType":20,"taxonomyTypeDesc":21},[108,109,110],"MCP","zoom","zoom mcp",{"skillNo":112,"name":113,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":25},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[117,118,119,109],"sdk","zoom apps sdk","apps",{"skillNo":121,"name":122,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":25},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[122],{"skillNo":127,"name":128,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":132,"publishedAt":25},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[131],{"categoryNo":95,"categoryName":96,"taxonomyType":20,"taxonomyTypeDesc":21},[128],{"skillNo":134,"name":135,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":25},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[135]]