docker-audit

Audit Dockerfiles and docker-compose stacks for security, correctness, and efficiency issues.

15|3|Updated Jul 9, 2026
One-click install
npx skills add https://github.com/thefear078/cursor-kit-for-ai --skill docker-audit-thefear078
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: docker-audit
Source: https://github.com/thefear078/cursor-kit-for-ai/tree/main/plugins/devops/skills/docker-audit
Command: npx skills add https://github.com/thefear078/cursor-kit-for-ai --skill docker-audit-thefear078

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Container configurations often ship with security holes, bloated images, and slow builds that go unnoticed until production. This Skill reviews Dockerfiles and docker-compose files against production standards and reports findings with severity levels instead of a flat checklist. ## Core Features & Use Cases - Three-Pass Audit: Checks security (non-root runtime, leaked secrets, pinned base images), correctness (healthchecks, signal handling, restart policies, resource limits), and efficiency (multi-stage builds, layer caching, cache cleanup). - Verification Commands: Runs concrete commands like docker history, docker inspect, hadolint, and trivy to confirm image size, user configuration, and leaked secrets. - Severity-Ranked Report: Outputs blockers, should-fix items, and optimizations, each with a corrected Dockerfile or compose snippet rather than vague advice. - Use Case: Before deploying a Python API, run the audit to discover the container runs as root, the image is 1.2GB because the build stage leaked into runtime, and the compose file binds ports publicly — then apply the provided fixed snippets. ## Quick Start Ask the AI to audit the Dockerfile and docker-compose.yml in the current project for security, size, and production readiness.

Frequently Asked Questions about docker-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit a Dockerfile for security issues?▼

Audit a Dockerfile by checking for a non-root USER directive, pinned base image digests, secrets in ARG or ENV layers, and minimal base images like slim or distroless. Verify with docker history --no-trunc and scanners like hadolint or trivy.

How to reduce Docker image size for production?▼

Reduce image size with multi-stage builds that copy only artifacts into a clean runtime stage, use slim or alpine bases, and clean package caches in the same RUN layer. A healthy Python API image is roughly 150-250MB; over 1GB means the build stage leaked into runtime.

Why does my Docker container ignore SIGTERM on stop?▼

SIGTERM is ignored when CMD uses shell form instead of exec form, or when the app spawns child processes without an init system. Use exec-form CMD ["app"] and add init: true or tini in compose so stops do not take 10 seconds.

Does docker-compose depends_on guarantee startup order?▼

depends_on with condition: service_healthy waits for a healthcheck but is not a guarantee of readiness. Applications still need their own retry logic for database and service connections after startup.

What are the security risks in docker-compose files?▼

Common compose risks include privileged: true, mounting docker.sock, unnecessary cap_add, and ports bound to all interfaces instead of 127.0.0.1. Missing resource limits like mem_limit and cpus also let one leaking container take down the host.