Docker Review

    by Krimesh Shah

    1

    Audit Dockerfiles for security leaks, non-root execution, and image size optimizations.

    Free

    Security scanned

    Works with the AI Agents you already use

    Docker Review

    Example session with this skill installed

    Review my Dockerfile for security risks and image size issues:
    FROM python:3.9
    COPY . /app
    WORKDIR /app
    RUN pip install -r requirements.txt
    CMD ["python", "app.py"]

    • Read your context and instructions
    • Compiled the docker review

    I have reviewed your Dockerfile. It contains several critical security risks and optimization opportunities, including root execution and excessive image bloat.

    Docker Review Report

    CategoryFindingSeverityRecommendation
    SecurityProcess running as rootHighAdd a non-root USER and group to run the application.
    SecurityUnpinned base imageMediumChange python:3.9 to a specific digest or minor version like python:3.9.18-slim.
    OptimizationMissing .dockerignoreMediumEnsure .git, __pycache__, and local secrets are excluded from the build context.
    OptimizationLayer BloatLowCombine WORKDIR and COPY instructions. Use multi-stage builds to discard build tools.
    ReliabilityShell form CMDLowUse the exec form CMD ["python", "app.py"] to ensure signals reach the process.
    OptimizationCache ManagementLowRun pip install with --no-cache-dir to reduce image size by avoiding local caches.

    Optimized Dockerfile Suggestion

    
    # Stage 1: Build
    FROM python:3.9.18-slim AS builder
    WORKDIR /build
    COPY requirements.txt .
    RUN pip install --user --no-cache-dir -r requirements.txt
    
    # Stage 2: Runtime
    FROM python:3.9.18-slim
    RUN groupadd -g 999 appuser && useradd -r -u 999 -g appuser appuser
    WORKDIR /app
    COPY --from=builder /root/.local /home/appuser/.local
    COPY . .
    ENV PATH=/home/appuser/.local/bin:$PATH
    USER appuser
    HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/ || exit 1
    ENTRYPOINT ["python"]
    CMD ["app.py"]
    

    Next steps

    1. Create a .dockerignore file to exclude *.pyc and .env files.
    2. Build the image with the new USER configuration and verify volume permissions.
    3. Add a specific HEALTHCHECK command tailored to your application's health endpoint.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Writing secure, production-ready Dockerfiles is a tedious manual process prone to leaking secrets or bloating image sizes. This skill audits your container configuration to ensure it follows industry standards for security and reliability.

    What it does

    • Security auditing checks for non-root users and accidental secret exposure in image layers.
    • Image optimization identifies missing multi-stage builds and leftover package caches.
    • Dependency pinning flags unpinned base images or floating package versions.
    • Context filtering verifies .dockerignore coverage for local artifacts like .git or secrets.
    • Runtime validation reviews ENTRYPOINT signals, health checks, and filesystem privileges.

    How it works

    1. Provide a Dockerfile or a path to a directory containing container configurations.
    2. The skill analyzes the build instructions and runtime settings against reliability criteria.
    3. It generates a report highlighting specific risks like root execution or privileged modes.
    4. You receive actionable feedback to refactor the build process or minimize image footprints.

    Why this beats prompting it yourself

    Generic prompts often miss the nuances of signal handling or layer caching. This skill uses a specific checklist to catch low-level issues like missing .dockerignore files or improper CMD formats that lead to zombie processes.

    Use cases

    • Audit legacy Dockerfiles for security vulnerabilities before production deployment.
    • Reduce CI/CD pipeline times by optimizing build layers and caching.
    • Enforce non-root execution and minimal base images across microservices.
    • Ensure containerized apps handle shutdown signals correctly via ENTRYPOINT.

    Known limitations

    Does not perform active vulnerability scanning against CVE databases. Requires manual verification of specific package version security.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 5 days ago

    • Free with an Agensi account

    Permissions

    No special permissions declared or detected

    Listed5 days ago

    What's inside

    Frequently Asked Questions

    This skill audits container configurations to detect security risks like root user execution and secret exposure, while also identifying ways to reduce image size and improve build reliability. It helps you catch low-level issues such as improper signal handling or missing build optimizations that are often missed during manual reviews.

    You only need to provide the Dockerfile you wish to audit or a path to the directory containing your container configurations. Your AI agent handles the analysis through this skill without requiring additional third-party accounts or external software.

    The skill produces a detailed report highlighting specific risks such as privileged modes or unpinned base images. You receive actionable feedback and specific recommendations to refactor your build process or minimize your image footprint.

    While the skill identifies configuration risks and dependency pinning issues, it does not perform active vulnerability scanning against CVE databases. You will still need to manually verify the security of specific package versions using a dedicated scanner.

    Simply ask your AI agent to review your Dockerfile for security and reliability or request an audit of a specific directory containing your build configurations. You can also ask it to specifically check for image optimizations or non-root execution compliance.

    New in DevOps & Cloud

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.

    Free