docker-shared
Shared Docker building blocks — base images for private registries, .dockerignore conventions, compose fragment reuse with YAML anchors.
Skill by ajyadav013
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ajyadav013-docker-shared
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: devops, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/docker-shared
What's inside
- Skill name
docker-shared- Description
- 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.
- License
- MIT
- Instructions
- 394 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (5)
- SKILL.md
- dockerignore-and-build-secrets.md · references/
- repo-evidence.md · references/
- shared-base-images.md · references/
- shared-compose-fragments.md · references/
SKILL.md (first lines)
# 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 development; switch to digest pinning (`@sha256:...`) in production for immutable guarantees.
**Multi-service reuse**: A single base image can serve multiple related services that share dependencies (e.g., a Python 3.11 base with PostgreSQL client, Kafka libs, and Kerberos tools used by 3-4 backend services).
**Workflow**: Build the base image, push to registry with a new tag (e.g., `v13`), update service Dockerfiles to reference the new tag, rebuild service images.
### Private Registry Authentication
**Build-time auth with ARG**: Pass a private registry or package manager token as a `--build-arg` at build time. The Dockerfile declares `ARG REGISTRY_TOKEN` and uses it to authenticate `docker login`, `pip install` from private package indexes, or `curl` to fetch private scripts.
**CRITICAL ANTI-PATTERN**: **NEVER echo, print, or write a build-arg secret to a RUN layer or the console.** Even a debug `RUN echo "$REGISTRY_TOKEN"` or `printf "%s\n" "$REGISTRY_TOKEN"` bakes the secret into the image layer and build logs, making it recoverable from the final image or CI logs.
**Secure alternative**: Use BuildKit `--secret` and `RUN --mount=type=secret,id=token` for build-time secrets that never appear in layers. For local dev without BuildKit, use a `.env` file with the token and pass via `docker build --build-arg REGISTRY_TOKEN=$(cat .env | grep TOKEN | cut -d= -f2)`, but never commit the `.env`.
**Example ARG pattern** (genericized, with anti-pattern shown for educational purposes):
```dockerfile
# Dockerfile.base
FROM python:3.11-slim
ARG PRIVATE_REGISTRY_TOKEN
# ❌ ANTI-PATTERN: This bakes the token into the image layer and build logs
# RUN echo "===== TOKEN START =====" && \
# printf "%s\n" "$PRIVATE_REGISTRY_TOKEN" && \
# echo "===== TOKEN END ====="
# ✅ Correct: Use the token WITHOUT printing it
RUN apt-get update && \
apt-get install -y curl git && \
curl -H "Authorization: Bearer $PRIVATE_REGISTRY_TOKEN" \
https://internal-registry.example.com/scripts/setup.sh -o /tmp/setup.sh && \
sh /tmp/setup.sh && \
rm /tmp/setup.sh
```
**BuildKit secret mount** (preferred):
```dockerfile
# syntax=docker/dockerfile:1.4
FROM python:3.11-slim
RUN --mount=type=secret,id=registry_token \
REGISTRY_TOKEN=$(cat /run/secrets/registry_token) && \
curl -H "Authorization: Bearer $REGISTRY_TOKEN" \
https://internal-registry.example.com/scripts/setup.sh -o /tmp/setup.sh && \
sh /tmp/setup.sh && \
rm /tmp/setup.sh
# Build with: docker buildx build --secret id=registry_token,src=token.txt .
```
### .dockerignore Conventions
**Purpose**: Exclude files from the build context to reduce image size, speed up builds, and prevent secrets from leaking into images.
**Standard exclusions**:
- **Version control**: `.git`, `.gitignore`
- **Dependencies**: `node_modules/`, `.venv/`, `venv/`, `__pycache__/`, `*.pyc`
- **Tests and coverage**: `tests/`, `*.test.js`, `.pytest_cache/`, `.coverage`, `htmlcov/`
- **Secrets**: `.env`, `.env.local`, `.env.*.local`, `.env.secrets`, `*.key`, `*.pem` (unless explicitly needed)
- **IDE**: `.vscode/`, `.idea/`, `*.swp`, `*.swo`
- **OS**: `.DS_Store`, `Thumbs.db`
- **Logs and artifacts**: `*.log`, `logs/`, `screenshots/`, `videos/`, `dist/`, `build/`
- **Docker files**: `Dockerfile*`, `docker-compose*`, `.dockerignore` (the Docker files themselves don't belong in the image)
- **Documentation**: `*.md`, `docs/` (unless your image serves docs)
**Include exceptions**: Use `!` to re-include specific files after a broader exclusion (e.g., `*.md` excludes all markdown, `!README.md` includes only the README).
**Example .dockerignore**:
```
# Version control
.git
.gitignore
# Dependencies
node_modules
npm-debug.log*
__pycache__
*.pyc
.venv
venv
# Tests
tests/
.pytest_cache/
.coverage
htmlcov/
# Secrets
.env
.env.*
*.key
*.pem
# IDE
.vscodeFrom ajyadav013/claude-kit, MIT.
More from ajyadav013/claude-kit
- 0.602score
design-patterns-and-conventions
ajyadav013
Cross-cutting design patterns, naming, folder layout, and anti-patterns for production Python/FastAPI backends.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
auth-and-rbac
ajyadav013
FastAPI auth patterns — session/JWT chains, argon2id hashing, pyotp TOTP/Email OTP, role-based access control, x-user-data gateway forwarding.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
backend-repo-architecture
ajyadav013
Canonical backend repository structure for Python/FastAPI — multi-mode entrypoint, app factory, ConnectionManager, BaseDao, flat vs versioned layout.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
data-engineering-bigquery-gcs
ajyadav013
BigQuery medallion architecture (bronze/silver/gold), parameterized queries, MERGE upserts, partitioning, CDC dedup, Temporal orchestration.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
api-pagination-filtering-sorting
ajyadav013
HTTP query parameter conventions for pagination, filtering, sorting, and search with standardized response metadata.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
async-python-patterns
ajyadav013
Async Python for high-performance services.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
code-simplification
ajyadav013
Simplifies/refactors working code for clarity without changing behavior.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
anthropic-vertex-integration
ajyadav013
Claude on Vertex AI via the AnthropicVertex SDK — lazy ADC client init, env-based project/region resolution, async helpers, backoff retry.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
dockerfile-backend
ajyadav013
Multi-stage Dockerfiles for Python/FastAPI backends — builder vs runtime, slim vs alpine, system deps, layer caching, non-root users.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
cron-and-scheduled-jobs
ajyadav013
Scheduled jobs across two mechanisms — Kubernetes CronJobs (schedule in Helm values, MODE=cron) and Temporal Schedules.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
api-and-interface-design
ajyadav013
Stable API and interface design patterns.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
distributed-systems-patterns
ajyadav013
Distributed data placement and replication — consistent hashing/vnodes, sharding, N/W/R quorums, KV-store and cache anatomy, gossip failure detection, B-tree…
SkillBFreshness: B★ 14Claude Code +9
Signals
- Stars
- 14
- Forks
- 5
- Open issues
- 9
- Last commit (this folder)
- Aug 22, 2026 (2 months ago)
- Last release
- Sep 7, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/ajyadav013/claude-kit
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from ajyadav013
- 0.602score
anthropic-vertex-integration
ajyadav013
Claude on Vertex AI via the AnthropicVertex SDK — lazy ADC client init, env-based project/region resolution, async helpers, backoff retry.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
api-and-interface-design
ajyadav013
Stable API and interface design patterns.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
code-simplification
ajyadav013
Simplifies/refactors working code for clarity without changing behavior.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
cron-and-scheduled-jobs
ajyadav013
Scheduled jobs across two mechanisms — Kubernetes CronJobs (schedule in Helm values, MODE=cron) and Temporal Schedules.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
dockerfile-backend
ajyadav013
Multi-stage Dockerfiles for Python/FastAPI backends — builder vs runtime, slim vs alpine, system deps, layer caching, non-root users.
SkillBFreshness: B★ 14Claude Code +9 - 0.602score
api-pagination-filtering-sorting
ajyadav013
HTTP query parameter conventions for pagination, filtering, sorting, and search with standardized response metadata.
SkillBFreshness: B★ 14Claude Code +9
Cite this page
docker-shared skill. Agent Mart. https://agentmart.dev/skills/ajyadav013-docker-shared (last updated 2026-10-24)