Skip to content
Back to skills

Debug Container

ASecurity

Finds why a Docker container exits, restarts or misbehaves by reading its logs, exit code, config and Dockerfile together.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 15, 2026
ai-agentsshelldocker

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill debug-container --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Debug Container?

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

Security grade badge for Debug Container
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-debug-container-ai-agent-templates/badge)](https://www.skillsdirectory.com/skills/workspace-templates-debug-container-ai-agent-templates)

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: debug-container
description: Finds why a Docker container exits, restarts or misbehaves by reading its logs, exit code, config and Dockerfile together.
disable-model-invocation: true
---

Debug this container: $ARGUMENTS (container name or id, or a compose service; if empty, check the most recently exited one).

1. Inspect state with read-only commands: `docker ps -a --filter "name=..."`, `docker inspect --format '{{.State.ExitCode}} {{.State.OOMKilled}} {{.State.Error}}' <c>`, and `docker logs --tail 100 <c>`.
2. Read the exit code: 0 means the main process finished, 1 an app error, 125 to 127 a bad command or missing binary, 137 killed (memory limit or manual stop), 139 a crash, 143 stopped by SIGTERM.
3. Compare the entrypoint and CMD from `docker inspect` with the Dockerfile. Look for shell versus exec form, missing executable bits, wrong WORKDIR, a process that daemonizes and exits, and files removed by .dockerignore.
4. Check configuration: environment variables, mounted volumes, network and published ports, healthcheck result, and depends_on ordering in the compose file.
5. If the container is running, you may use `docker exec <c> ls` or `env` to look inside. Do not change anything.

Report the most likely cause first, the evidence from each step, and the exact fix (a Dockerfile or compose edit). Ask before editing files, restarting, or running `docker rm`.

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 ai-agents →

Comments

Loading comments…

Newsletter

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