container-craft

Guide Dockerfile construction for small, secure, reproducible container images.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/prapanch/agent-coda --skill container-craft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: container-craft
Source: https://github.com/prapanch/agent-coda/tree/main/devops/container-craft
Command: npx skills add https://github.com/prapanch/agent-coda --skill container-craft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you prevent slow builds, oversized images, and avoidable container vulnerabilities by applying consistent Docker and OCI container construction practices.

Core Features & Use Cases

  • Multi-stage Docker builds: Separate build-time dependencies from runtime so production images stay lean and safer.
  • Layer and version discipline: Order layers by change frequency and pin versions for reproducibility and reliable caching.
  • Runtime hardening: Run as non-root, minimize attack surface, use .dockerignore, and add health checks for operational correctness.
  • Security and size tradeoffs: Compare base image choices (alpine, distroless, scratch) and use targeted tooling and checks to validate improvements.

Use cases include writing and reviewing Dockerfiles, troubleshooting slow/unsafe container builds, and hardening images before deploying to production environments.

Quick Start

Ask the agent to review your Dockerfile and propose a multi-stage, pinned-version, non-root build that includes a correct .dockerignore, health check, and security checklist.

Frequently Asked Questions about container-craft

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Dockerfile layer order for faster build caching?

Optimize Dockerfile layer caching by ordering instructions from least to most frequently changed, placing stable dependencies early and application code last to maximize cache hits and reduce build times.

How does a multi-stage Docker build reduce image size?

Multi-stage builds reduce image size by separating build-time dependencies from the runtime, copying only compiled artifacts to a lean final image to keep production containers small and secure.

What is the best way to run a Docker container as a non-root user?

The best way to run a non-root Docker container is by creating a dedicated user in the Dockerfile and using the USER instruction to enforce runtime hardening, minimizing the container's attack surface.

When do I need reproducible container builds with pinned versions?

You need reproducible container builds with pinned versions when deploying production services that require reliable caching, predictable behavior, and consistent environments across different build stages.

Alpine vs distroless vs scratch: which Docker base image is best for security?

Choosing between alpine, distroless, and scratch base images involves security and size tradeoffs; distroless minimizes the attack surface by excluding package managers while providing essential runtime libraries.

Why do I need a .dockerignore file for production builds?

A .dockerignore file is needed for production builds to exclude unnecessary local files and secrets from the build context, preventing accidental inclusion in images and speeding up the build process.