Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Docker Ops: Small, Secure Containers

    1

    Dockerize any app and fix container problems: multi-stage small images, cached builds, non-root, healthchecks, secrets done right, dev/prod compose, and a debug playbook for crashes, networking, volumes and disk space.

    Free

    7 usesSecurity scanned
    Docker Ops: Small, Secure Containers

    Docker Ops: Small, Secure Containers

    Example session with this skill installed

    I need to dockerize my Node.js API. It uses npm, needs a Postgres database, and I want to make sure the image is small and doesn't run as root.

    • Read your context and instructions
    • Compiled the docker ops

    I have analyzed your project and generated a multi-stage Dockerfile and a Docker Compose configuration. The setup uses node:22-slim to minimize the attack surface and image size, implements a non-root user, and includes healthchecks for database synchronization.

    Production Docker Configuration

    
    # syntax=docker/dockerfile:1
    FROM node:22-slim AS deps
    WORKDIR /app
    COPY package.json package-lock.json ./
    RUN --mount=type=cache,target=/root/.npm npm ci
    
    FROM deps AS build
    COPY . .
    RUN npm run build && npm prune --omit=dev
    
    FROM node:22-slim AS runtime
    ENV NODE_ENV=production
    WORKDIR /app
    
    # Ensure non-root ownership
    COPY --from=build --chown=node:node /app/node_modules ./node_modules
    COPY --from=build --chown=node:node /app/dist ./dist
    
    USER node
    EXPOSE 3000
    
    HEALTHCHECK --interval=30s --timeout=3s \
      CMD node -e "fetch('http://localhost:3000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
    
    CMD ["node", "dist/server.js"]
    
    services:
      api:
        build: .
        ports:
          - "3000:3000"
        env_file: .env
        depends_on:
          db:
            condition: service_healthy
        networks:
          - app-network
    
      db:
        image: postgres:16-alpine
        volumes:
          - postgres_data:/var/lib/postgresql/data
        environment:
          POSTGRES_DB: appdb
          POSTGRES_USER_FILE: /run/secrets/db_user
          POSTGRES_PASSWORD_FILE: /run/secrets/db_password
        healthcheck:
          test: ["CMD-SHELL", "pg_isready -U postgres"]
          interval: 10s
          timeout: 5s
          retries: 5
        networks:
          - app-network
    
    networks:
      app-network:
        driver: bridge
    
    volumes:
      postgres_data:
    

    Next steps

    1. Create a .dockerignore file including node_modules, .git, and .env.
    2. Run docker compose up --build to verify the multi-service orchestration.
    3. Check the image size using docker images to confirm the slim runtime is effective.

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

    About this skill

    Docker configurations often result in bloated images, insecure root users, and broken caching that slows down CI/CD. This skill builds production-ready Docker environments that are slim, fast, and secure by default. ## What it does - **Multi-stage builds** creates optimized images by separating build dependencies from the final runtime. - **Cache optimization** structures Dockerfiles to leverage layer caching and BuildKit cache mounts. - **Hardened security** implements non-root users, secret mounting, and minimal base images. - **Compose orchestration** manages multi-service stacks with healthchecks and proper network isolation. - **Incident debugging** identifies root causes for OOM kills, network failures, and exit codes. ## How it works 1. Detects your tech stack and runtime versions from lockfiles or configuration files. 2. Generates a multi-stage Dockerfile and a `compose.yaml` with appropriate volumes and networks. 3. Configures `.dockerignore` to prevent sensitive or unnecessary files from leaking into layers. 4. Performs a build check to report final image size and verification steps. ## Frameworks & tools Works with any language runtime including Node.js, Python, Go, and Rust. Supports Docker BuildKit, Docker Compose, and container scanning tools like Trivy or Docker Scout. ## Why this beats prompting it yourself Generic prompts often miss critical production details like signal handling (SIGTERM), non-root permissions, and `.dockerignore` patterns. This skill follows strict BuildKit patterns and multi-stage logic to ensure your images are actually deployable, not just runnable. ## Use cases - Containerizing a legacy application for cloud migration. - Shrinking oversized images that are slowing down deployment pipelines. - Fixing connectivity issues between app containers and databases. - Auditing existing Dockerfiles for security vulnerabilities and root user usage. ## Known limitations Requires BuildKit enabled for cache mounts and secrets. Does not perform automatic image pushes to registries without explicit confirmation.

    Requires BuildKit for cache mounts and secrets. Does not automate registry authentication or CI provider secrets setup.

    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 any payment.

    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

    7 uses

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 7 days ago

    • Free with an Agensi account

    Permissions

    Network Access
    Read Files
    Write Files
    Listed7 days ago
    Updated5 days ago

    What's inside

    Frequently Asked Questions

    The skill scans your project lockfiles and configurations to automatically generate multi-stage Dockerfiles and Compose stacks that prioritize minimal image size, non-root security, and efficient BuildKit caching.

    Yes, this skill is language-agnostic and works with any runtime, including Node.js, Python, Go, and Rust, by detecting specific dependency patterns and applying best-practice templates for those environments.

    While it creates production-ready Compose files and Dockerfiles, it does not directly manage Kubernetes YAML or Helm charts, though the images it builds are fully compatible with any OCI-compliant orchestrator.

    You will receive the core logic for the Docker Ops skill, which includes specialized modules for multi-stage builds, security hardening, and cache optimization, ready to be integrated into your preferred AI agent.

    The skill requires Docker BuildKit to be enabled to utilize advanced features like secret mounting and cache mounts; it also assumes a standard project structure for detecting your tech stack.

    Absolutely—the skill can audit your current Dockerfiles to identify bloated layers, security vulnerabilities like root user execution, and missing signal handling, providing a refactored version as an output.

    New in DevOps & Cloud