- Home
- Skills
- DevOps & Cloud
- Docker Ops: Small, Secure Containers
Works with the AI Agents you already use
Docker Ops: Small, Secure Containers
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
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
- Create a
.dockerignorefile includingnode_modules,.git, and.env. - Run
docker compose up --buildto verify the multi-service orchestration. - Check the image size using
docker imagesto 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
- Detects your tech stack and runtime versions from lockfiles or configuration files.
- Generates a multi-stage Dockerfile and a
compose.yamlwith appropriate volumes and networks. - Configures
.dockerignoreto prevent sensitive or unnecessary files from leaking into layers. - 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.
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.
Requires BuildKit for cache mounts and secrets. Does not automate registry authentication or CI provider secrets setup.
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
7 uses
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 7 days ago
- Free with an Agensi account