KS
Killer-Skills

debugging-docker — how to debug Docker how to debug Docker, debugging-docker tutorial, Docker troubleshooting guide, debugging-docker vs traditional debugging, debugging-docker install, debugging-docker setup for multi-platform environments, GAMP-5 validation for Docker, Docker performance optimization techniques

v1.0.0
GitHub

About this Skill

Perfect for DevOps Agents needing systematic Docker troubleshooting workflows for build failures and runtime errors in multi-platform environments debugging-docker is a systematic approach to troubleshooting Docker operations, including build failures, runtime errors, and performance optimization

Features

Troubleshoots Docker build failures, including package installation errors and COPY failures
Resolves runtime errors, such as container crashes and exit codes
Optimizes performance for multi-platform environments, including ARM64, AMD64, and WSL2
Supports GAMP-5 validation for pharmaceutical compliance contexts
Identifies and resolves layer caching issues and DNS resolution problems

# Core Topics

Danik911 Danik911
[0]
[0]
Updated: 3/6/2026

Quality Score

Top 5%
57
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add Danik911/thesis_project/debugging-docker

Agent Capability Analysis

The debugging-docker MCP Server by Danik911 is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to debug Docker, debugging-docker tutorial, Docker troubleshooting guide.

Ideal Agent Persona

Perfect for DevOps Agents needing systematic Docker troubleshooting workflows for build failures and runtime errors in multi-platform environments

Core Value

Empowers agents to diagnose and resolve Docker build failures, runtime errors, and performance optimization issues using systematic troubleshooting workflows, including package installation errors, COPY failures, and layer caching issues, with support for AWS container services and GAMP-5 validation

Capabilities Granted for debugging-docker MCP Server

Debugging Docker build failures due to package installation errors or COPY failures
Resolving runtime errors such as container crashes or DNS resolution issues
Optimizing Docker performance in multi-platform environments, including ARM64, AMD64, and WSL2

! Prerequisites & Limits

  • Requires Docker installation and configuration
  • Limited to Docker-specific troubleshooting, not applicable to other containerization platforms
Project
SKILL.md
10.0 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

Debugging Docker Operations

Overview

Systematic troubleshooting workflows for Docker build failures, runtime errors, AWS container services, platform-specific issues, and performance optimization. Designed for multi-platform environments (ARM64/AMD64/WSL2) with pharmaceutical compliance contexts requiring GAMP-5 validation.

When to Use

  • Build Failures: Package installation errors, COPY failures, layer caching issues
  • Runtime Errors: Container crashes, exit codes, DNS resolution, port conflicts
  • AWS Container Services: ECR authentication, ECS pull failures, rate limiting
  • Platform Issues: ARM64 vs AMD64 emulation, WSL2 integration, cross-platform builds
  • Performance Problems: Slow builds, large images, QEMU emulation overhead
  • Volumes/Networking: Permission errors, mount failures, port binding

Available Tools

Standard Tools

ToolPurpose
BashExecute Docker commands, view logs
ReadExamine Dockerfiles, compose files
GrepSearch for patterns in logs
GlobFind Docker-related files

AWS MCP Tools

ToolPurpose
mcp__aws-api-mcp__call_awsExecute AWS CLI for ECR/ECS operations
mcp__aws-knowledge-mcp__aws___search_documentationSearch AWS docs for container guidance
mcp__aws-ccapi-mcp__list_resourcesList ECS tasks, ECR repositories

Core Workflow

Phase 1: Symptom Diagnosis

Objective: Identify problem category and gather diagnostic information

  1. Identify Problem Type

    bash
    1# For build failures 2docker build 2>&1 | tee build.log 3 4# For runtime errors 5docker logs <container-name> 6docker inspect <container-name> 7 8# For AWS issues 9aws ecr describe-repositories 10aws ecs describe-tasks --cluster <cluster> --tasks <task-arn>
  2. Categorize the Issue

    • Build Failure (exit during docker build)
    • Runtime Error (container exits or crashes)
    • AWS ECR/ECS Issue (authentication, pull failures)
    • Platform/Architecture Issue (ARM64/AMD64 mismatch)
    • Performance Problem (slow or inefficient)
    • Networking/Volume Issue
  3. Collect Context

    bash
    1docker version && docker info | head -30 2uname -m # Platform: x86_64 or aarch64

Quality Gate: Problem type identified, initial logs collected


Phase 2: Root Cause Analysis

Build Failures

Common Patterns:

bash
1# Check build log for specific failures 2grep -E "ERROR|failed|error:" build.log 3 4# Common patterns: 5# "COPY failed" → File not in build context 6# "returned a non-zero code" → Command failed 7# "no matching manifest" → Platform mismatch

Key Checks:

  • Build context: ls -la <path-to-file>
  • .dockerignore: cat .dockerignore
  • Layer caching: docker build --no-cache

See reference/common-errors.md for complete error matrix.

Runtime Errors

Exit Code Quick Reference:

CodeMeaningCommon Cause
0Normal exitApplication completed
1Application errorCheck application logs
126Cannot executePermission issue
127Command not foundWrong CMD/ENTRYPOINT
137OOM killedMemory limit exceeded
139SegfaultApplication crash
143SIGTERMGraceful shutdown

Diagnosis:

bash
1docker inspect <container> | jq '.[0].State' 2docker logs --tail 100 <container>

AWS ECR/ECS Issues

ECR Authentication:

Error: "no basic auth credentials"
  • Cause: ECR login token expired (12-hour validity)
  • Fix:
    bash
    1aws ecr get-login-password --region eu-west-2 | \ 2 docker login --username AWS --password-stdin \ 3 <account-id>.dkr.ecr.eu-west-2.amazonaws.com

ECS Pull Failures:

Error: "CannotPullContainerError"
  • Checklist:
    1. Task execution role has ECR permissions
    2. VPC has NAT Gateway (for private subnets)
    3. Image tag exists in ECR

Using AWS MCP:

# Check ECR images
mcp__aws-api-mcp__call_aws: aws ecr describe-images --repository-name <repo>

# Check ECS task failures
mcp__aws-api-mcp__call_aws: aws ecs describe-tasks --cluster <cluster> --tasks <task-arn>

See reference/aws-ecr-ecs.md for complete AWS troubleshooting guide.

Platform/Architecture Issues

Slow Build Detection:

bash
1# Check if emulation is active (ARM64 host building AMD64) 2docker run --rm --platform=linux/amd64 alpine uname -m 3# If output shows x86_64 on ARM64 host → emulation active (slow)

Solutions:

  1. Use native platform for development
  2. Build target platform only for deployment
  3. Use multi-stage with ${BUILDPLATFORM}

See reference/platform-guide.md for complete platform guidance.

Quality Gate: Root cause identified, specific error patterns documented


Phase 3: Solution & Validation

Build Failure Fixes

dockerfile
1# Fix missing file in context 2# Verify path exists: ls -la <path> 3COPY main.py /app/ 4 5# Fix package installation with retry 6RUN pip install --no-cache-dir -r requirements.txt || \ 7 (pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt) 8 9# Fix platform issues 10# docker build --platform=linux/amd64 -t image:prod .

Runtime Error Fixes

bash
1# Fix permission issues 2docker run --user $(id -u):$(id -g) image:tag 3 4# Fix OOM (Exit 137) 5docker run -m 2g --memory-swap 2g image:tag 6 7# Fix port conflicts 8docker run -p 8081:8080 image:tag # Change host port

AWS Fixes

bash
1# Refresh ECR credentials 2aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin <account>.dkr.ecr.eu-west-2.amazonaws.com 3 4# Fix Docker Hub rate limiting - use ECR Public 5# FROM public.ecr.aws/docker/library/python:3.12-slim

Validation

bash
1# Rebuild with verbose output 2docker build --progress=plain -f Dockerfile -t image:test . 3 4# Test container startup 5docker run --rm image:test 6 7# Verify functionality 8docker run -it image:test /bin/sh -c "command-to-test"

Quality Gate: Fix applied, container builds and runs without errors


Quick Reference Table

ProblemQuick CheckCommon Fix
ECR "no basic auth"Token age (12hr)aws ecr get-login-password | docker login
ECS CannotPullTask role, NATCheck IAM + VPC config
Docker Hub rate limitError messageUse ECR Public or authenticate
Build fails at COPYls -la <file>Fix path or add to build context
Package install failsCheck networkUpdate pip, verify package name
Exit 137 (OOM)docker inspect OOMKilledIncrease memory limit (-m flag)
Exit 127Command not foundFix CMD/ENTRYPOINT path
Slow ARM64 build--platform flagUse native ARM64 for dev
WSL2 vmmem bloatTask Manager.wslconfig memory limits
Volume mount not workingCheck compose mountsdocker-compose down && up -d
Port already in usedocker psChange host port or stop conflict
Permission deniedCheck USER in DockerfileAdd USER directive, fix volume perms

Best Practices

Build Optimization

  • Layer ordering: Dependencies before code (cache efficiency)
  • Multi-stage builds: Separate build and runtime environments
  • Use .dockerignore: Exclude node_modules, .git, __pycache__

Security

dockerfile
1# Non-root user 2RUN adduser -D appuser 3USER appuser 4 5# Never COPY secrets - use --secret flag

Platform Handling

bash
1# Development (native platform - fast) 2docker build -t image:dev . 3 4# Production (target platform) 5docker build --platform=linux/amd64 -t image:prod . 6 7# Multi-platform with cache 8docker buildx build \ 9 --platform linux/amd64,linux/arm64 \ 10 --cache-from type=registry,ref=<repo>:cache \ 11 --cache-to type=registry,ref=<repo>:cache \ 12 -t image:multi --push .

WSL2 Performance

  • Store projects in WSL2 filesystem (~/), NOT Windows mount (/mnt/c/)
  • Configure .wslconfig with memory limits
  • Use wsl --shutdown to reclaim memory

See reference/wsl2-optimization.md for complete WSL2 guide.


Common Pitfalls

Don't: Use relative paths without verification

dockerfile
1# WRONG - may fail if context is incorrect 2COPY ../app/file.py /app/ 3 4# RIGHT - relative to build context root 5COPY app/file.py /app/

Do: Use explicit platform for production

bash
1# WRONG - platform inferred (may differ from prod) 2docker build -t api:latest . 3 4# RIGHT - explicit platform 5docker build --platform=linux/amd64 -t api:latest .

Do: Verify volume mounts work

bash
1# Check if container sees host files 2docker exec <container> ls -la /app/ 3 4# Recreate containers after mount changes 5docker-compose down && docker-compose up -d

Quality Checklist

  • Problem type identified (build/runtime/AWS/platform/network/volume)
  • Diagnostic logs collected and analyzed
  • Root cause determined with specific error patterns
  • Solution applied with appropriate fix
  • Build succeeds without errors
  • Container starts and runs successfully
  • Functionality validated
  • Platform architecture verified (matches deployment target)
  • Security checked (non-root user, no exposed secrets)

Detailed References

  • Docker Commands: reference/docker-commands.md
  • Common Error Matrix: reference/common-errors.md (20+ error patterns)
  • AWS ECR/ECS Guide: reference/aws-ecr-ecs.md
  • Platform Guide: reference/platform-guide.md (ARM64/AMD64/WSL2, buildx caching)
  • WSL2 Optimization: reference/wsl2-optimization.md
  • Build Optimization: reference/build-optimization.md
  • Security Hardening: reference/security-hardening.md

Diagnostic Scripts

  • Build Failure Analysis: scripts/analyze-build-failure.sh <log-file>
  • Container Inspection: scripts/inspect-container.sh <container-name>
  • Platform Check: scripts/check-platform.sh

Remember: Docker issues are systematic and diagnosable. Follow the three-phase workflow (Symptom → Root Cause → Solution), use AWS MCP tools for ECR/ECS issues, and reference the detailed guides for complex scenarios. Always validate fixes before considering the issue resolved.

Related Skills

Looking for an alternative to debugging-docker or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication