- Home
- Skills
- DevOps & Cloud
- Docker Review
Docker Review
by Krimesh Shah
Audit Dockerfiles for security leaks, non-root execution, and image size optimizations.
Free
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
| Category | Finding | Severity | Recommendation |
|---|---|---|---|
| Security | Process running as root | High | Add a non-root USER and group to run the application. |
| Security | Unpinned base image | Medium | Change python:3.9 to a specific digest or minor version like python:3.9.18-slim. |
| Optimization | Missing .dockerignore | Medium | Ensure .git, __pycache__, and local secrets are excluded from the build context. |
| Optimization | Layer Bloat | Low | Combine WORKDIR and COPY instructions. Use multi-stage builds to discard build tools. |
| Reliability | Shell form CMD | Low | Use the exec form CMD ["python", "app.py"] to ensure signals reach the process. |
| Optimization | Cache Management | Low | Run 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
- Create a
.dockerignorefile to exclude*.pycand.envfiles. - Build the image with the new
USERconfiguration and verify volume permissions. - Add a specific
HEALTHCHECKcommand 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
.dockerignorecoverage for local artifacts like.gitor secrets. - Runtime validation reviews
ENTRYPOINTsignals, health checks, and filesystem privileges.
How it works
- Provide a
Dockerfileor a path to a directory containing container configurations. - The skill analyzes the build instructions and runtime settings against reliability criteria.
- It generates a report highlighting specific risks like root execution or privileged modes.
- 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
What's inside
Frequently Asked Questions
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.