# Ops Docker Foundations

> Mastering the container lifecycle and professional Dockerfile creation.

- Skill: `jcorpac/ops-docker-foundations` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jcorpac/ops-docker-foundations`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jcorpac/ops-docker-foundations/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: jcorpac (https://skillmd.com/u/jcorpac)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/jcorpac/ops-docker-foundations

---


# Docker Foundations

Containers provide consistent environments across development and production.

## Image Layers
- **Caching**: Structure your `Dockerfile` to put static layers (like OS updates) at the top and changing layers (code) at the bottom to speed up rebuilds.
- **Images vs Containers**: An image is the blueprint; a container is the running instance.

## Professional Dockerfile
- **Base Images**: Use official, minimal images (e.g., `python:3.11-slim`).
- **Commands**: Master `RUN`, `COPY`, `WORKDIR`, `EXPOSE`, and `CMD`/`ENTRYPOINT`.

## Best Practices
- **Single Responsibility**: One service per container.
- **.dockerignore**: Exclude `node_modules`, `venv`, and `.git` to keep images small and secure.


