← ClaudeAtlas

docker-sharedlisted

Shared Docker building blocks — base images for private registries, .dockerignore conventions, compose fragment reuse with YAML anchors. Use when creating base images shared across multiple services.
ajyadav013/claude-kit · ★ 12 · AI & Automation · score 72
Install: claude install-skill ajyadav013/claude-kit
# Shared Docker Building Blocks Patterns for reusable Docker infrastructure across multiple services — base images, build hygiene, and compose fragment reuse. ## When to use - Creating a base image to share heavy system dependencies (gcc, build-essential, postgres client, Kafka libs) across multiple related services - Publishing base images to a private registry (Harbor, ECR, ACR, GCR) and consuming them with tag or digest pinning - Handling private registry / package authentication during image builds - Standardizing .dockerignore across services to exclude secrets, tests, and development artifacts - Sharing compose configuration fragments (common env vars, resource limits, logging config) across services using YAML anchors and extension fields - Connecting services to external infrastructure (shared Kafka cluster, Redis instance, custom network) via external networks and volumes ## Core conventions ### Shared Base Images **Pattern**: Create a `Dockerfile.base` that installs heavy, rarely-changing system dependencies (build tools, database clients, language runtimes, system libraries). Publish it to a private registry with versioned tags. Service Dockerfiles then `FROM <registry>/<org>/<service>-base:<tag>` to inherit those layers. **Why**: Avoids reinstalling the same heavy dependencies in every service Dockerfile; speeds up builds; ensures consistent system-level configuration across services. **Tag vs digest pinning**: Use tags (`v1`, `v2`, `v12`) for active devel