Skip to content
docker-troubleshoot logo

Docker Troubleshooting Skill

docker-troubleshoot

Diagnose container failures, networking issues, permissions, and port conflicts

SKILL.md

Full skill instructions

Docker Troubleshooting Skill

Overview

This skill helps diagnose and resolve common Docker issues:

  • Container startup failures
  • Networking problems
  • Permission errors
  • Port conflicts
  • Data persistence issues
  • Health check failures

Process

1. Consult Documentation

Read relevant documentation:

  • 17-troubleshooting.md for common issues
  • 15-port-conflicts.md for port problems
  • 16-restart-strategies.md for restart issues

2. Diagnose Issue

Gather information:

# Check container status
docker compose ps -a

# View logs
docker compose logs servicename

# Check configuration
docker compose config

# Inspect container
docker inspect containername

3. Apply Solution

Common Issues and Solutions

Container Won't Start

Diagnosis:

docker compose logs servicename
docker inspect --format='{{.State.ExitCode}}' containername

Solutions:

  • Check logs for error messages
  • Verify configuration syntax
  • Check dependencies are running
  • Verify image exists

Port Already in Use

Diagnosis:

lsof -i :3000
# or
netstat -tulpn | grep 3000

Solutions:

# Kill process
kill $(lsof -t -i:3000)

# Or change port in compose
ports:
  - "3001:3000"

Permission Denied

Diagnosis:

docker compose exec app ls -la /​app/​data

Solutions:

# Fix in compose
services:
  app:
    user: "1000:1000"

# Or fix in container
docker compose exec -u root app chown -R appuser:appgroup /​app/​data

Data Disappearing

Diagnosis:

docker volume ls
docker compose config | grep -A5 "volumes:"

Solutions:

# Use named volumes instead of anonymous
volumes:
  - postgres_data:/​var/​lib/​postgresql/​data  # Named (persists)
  # NOT: - /​var/​lib/​postgresql/​data  # Anonymous (deleted)

Container Can't Reach Other Container

Diagnosis:

docker network inspect networkname
docker compose exec app ping db
docker compose exec app nslookup db

Solutions:

# Ensure same network
services:
  app:
    networks:
      - backend
  db:
    networks:
      - backend

networks:
  backend:

Health Check Failing

Diagnosis:

docker inspect --format='{{json .State.Health}}' containername | jq

Solutions:

healthcheck:
  test: ["CMD", "curl", "-f", "http://localhost:3000/​health"]
  interval: 30s
  timeout: 10s
  retries: 3
  start_period: 40s  # Give time to start

Out of Disk Space

Diagnosis:

docker system df
docker system df -v

Solutions:

# Clean unused resources
docker system prune -a --volumes

Build Cache Issues

Solutions:

docker compose build --no-cache
docker builder prune -a

Debugging Commands

# Shell into running container
docker compose exec app sh

# Shell into failed container
docker compose run --entrypoint sh app

# View resource usage
docker stats

# View container processes
docker compose top

# View real-time events
docker events

# Copy files from container
docker compose cp app:/​app/​logs ./​logs

Quick Diagnostic Checklist

  1. Check if container is running: docker compose ps
  2. Check logs: docker compose logs servicename
  3. Check network: docker network ls
  4. Check volumes: docker volume ls
  5. Check resources: docker stats
  6. Validate config: docker compose config
  7. Check disk space: docker system df

Error Messages Reference

ErrorCauseSolution
"port is already allocated"Port in useKill process or change port
"network not found"Missing networkCreate network or check name
"volume not found"Missing volumeCreate volume or check name
"no such service"Service name typoCheck compose.yaml
"unauthorized"Auth issuedocker login
"image not found"Missing imagedocker compose pull
"permission denied"File permissionsFix ownership/​permissions
"out of memory"Memory limitIncrease limit or optimize app

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View