loom-docker
SolidDocker and container expertise.
DevOps & Infrastructure 54 stars
3 forks Updated today MIT
Install
Quality Score: 85/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Docker
## Overview
Production-grade containers: Dockerfiles, compose, multi-stage builds, layer/cache optimization, security hardening, registries, debugging. The **Expert Practices** section below is the highest-value part — it states the *mechanism* behind each rule, which is what separates correct-but-naive Dockerfiles from production ones. Read it before writing anything non-trivial.
## Writing Dockerfiles
**Base image:** official images; `-alpine`/`-slim`/distroless/`scratch` for runtime; pin by tag AND digest (`python:3.12-slim@sha256:...`, see Currency), never `latest`; multi-stage to drop build toolchains.
**Layer ordering (cache):** least-changing first (base → system deps → dependency manifests → source). **Copy dependency manifests and install BEFORE copying source** so a code edit doesn't bust the dependency layer — this single ordering rule is the biggest cache win.
**Layer hygiene:**
- Keep `apt-get update` and `apt-get install` in the SAME `RUN` — in separate layers Docker reuses a stale cached `update` index when only the install list changes, silently installing outdated/vulnerable packages (docs call this "cache busting"). Details in Anti-Patterns.
- `--no-install-recommends`, clean caches in the same layer (`rm -rf /var/lib/apt/lists/*`).
- `.dockerignore` to keep context small (excludes `.git`, `node_modules`, build artifacts) — bloated context slows builds and busts cache.
**Runtime & security:** non-root numeric `USER uid:gid` (see Gotchas); `-...
Details
- Author
- cosmix
- Repository
- cosmix/loom
- Created
- 8 months ago
- Last Updated
- today
- Language
- Rust
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
DevOps & Infrastructure Listed
docker-development
Use when optimising a Dockerfile, creating or improving docker-compose configurations, implementing multi-stage builds, auditing container security, or reducing image size. Triggers on "Dockerfile", "docker-compose", "container", "image size", "build cache", or "Docker best practices".
2 Updated 4 days ago
tmj-90 DevOps & Infrastructure Listed
docker
Docker containerization best practices for building, securing, and deploying containers.
2 Updated 1 months ago
Zephyrex21 AI & Automation Listed
ops-docker
Docker and Docker Compose containerization. Trigger when the user wants to dockerize an application or create containers.
5 Updated today
christopherlouet