AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Docker Agent

skill-chandrudp29-skillhub-docker-agent · by chandrudp29

Write optimized Dockerfiles, docker-compose configs, and debug container issues. Use when containerizing an app, fixing a broken container, or designing a multi-service local environment.

No reviews yet
0 installs
45 views
0.0% view→install

Install

$ agentstack add skill-chandrudp29-skillhub-docker-agent

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-chandrudp29-skillhub-docker-agent)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Docker Agent? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Docker Agent

Production-ready Dockerfiles and compose configs. Fixes common container problems fast.

When to Use

  • "Write a Dockerfile for my Python/Node/Go app"
  • "My container won't start"
  • "Set up docker-compose for my local dev environment"
  • "My image is 2GB — help me reduce it"

Python Dockerfile (production-ready)

# Build stage — install dependencies separately for cache efficiency
FROM python:3.12-slim AS builder
WORKDIR /build

# Install build deps first (changes rarely — cached layer)
COPY requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt

# Runtime stage — clean image without build tools
FROM python:3.12-slim AS runtime
WORKDIR /app

# Non-root user for security
RUN useradd --create-home appuser
USER appuser

# Copy installed packages from builder
COPY --from=builder /root/.local /home/appuser/.local
ENV PATH=/home/appuser/.local/bin:$PATH

# Copy app code last (changes most often — cache invalidated last)
COPY --chown=appuser:appuser . .

EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

Node.js Dockerfile

FROM node:20-alpine AS builder
WORKDIR /build
COPY package*.json .
RUN npm ci --only=production

FROM node:20-alpine AS runtime
WORKDIR /app
RUN adduser -D appuser
USER appuser
COPY --from=builder /build/node_modules ./node_modules
COPY --chown=appuser:appuser . .
EXPOSE 3000
CMD ["node", "server.js"]

docker-compose for Local Dev

# docker-compose.yml
services:
  api:
    build: .
    ports:
      - "8000:8000"
    environment:
      - DATABASE_URL=postgresql://postgres:password@db:5432/myapp
      - REDIS_URL=redis://redis:6379
    volumes:
      - .:/app          # hot reload in dev
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_started
    restart: unless-stopped

  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: myapp
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    volumes:
      - redis_data:/data

volumes:
  postgres_data:
  redis_data:

Reducing Image Size

  1. Use slim/alpine base images: python:3.12-slim (150MB) vs python:3.12 (1GB)
  2. Multi-stage builds: compile in builder, copy artifacts to clean runtime
  3. Combine RUN commands: each RUN is a layer
  4. Use .dockerignore: exclude node_modules/, .git/, __pycache__/, *.pyc, tests/
# .dockerignore
.git
.gitignore
__pycache__
*.pyc
*.pyo
.env
.venv
node_modules
tests/
*.md
Dockerfile*
docker-compose*
  1. Don't install dev dependencies in production image:
RUN pip install --no-cache-dir -r requirements.txt  # not requirements-dev.txt

Debugging Container Issues

# Container won't start — check logs
docker logs  --tail 50

# Container exits immediately — run interactively to debug
docker run -it --entrypoint /bin/sh myimage

# Check what's inside a running container
docker exec -it  /bin/sh

# Inspect environment variables
docker exec  env

# Check network connectivity between services
docker exec  curl http://db:5432

# Check if healthcheck is passing
docker inspect  | jq '.[0].State.Health'

# Rebuild without cache (when a dependency changed)
docker-compose build --no-cache api

Common Mistakes

| Mistake | Fix | |---|---| | Running as root | Add RUN useradd appuser && USER appuser | | COPY . . before installing deps | Copy requirements.txt first, install, then COPY . . | | Hardcoded secrets in Dockerfile | Use --build-arg or --secret (BuildKit) | | No .dockerignore | Always add one — node_modules alone adds hundreds of MB | | CMD python app.py | Use CMD ["python", "app.py"] (exec form — proper signal handling) | | Port exposed but not published | EXPOSE documents; -p 8000:8000 publishes |

Health Checks

HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
  CMD curl -f http://localhost:8000/health || exit 1

Or in compose:

healthcheck:
  test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
  interval: 30s
  timeout: 10s
  retries: 3
  start_period: 40s  # grace period on startup

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.