# Docker patterns

> Docker patterns is an open-source agent skill for developer tools. Docker and Compose patterns for dev stacks, container hardening and isolated installer. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/smartworldarafath/REA_Skill/tree/main/.agents/skills/docker-patterns
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 66
- **License:** MIT
- **Skill name:** docker-patterns
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill gives an agent a reference set of Docker and Docker Compose patterns for local development: multi-service stacks with Postgres, Redis and a mail catcher, multi-stage Dockerfiles that separate dev and production targets, override files, service networking, and volume layouts. It also covers container security, including pinned tags, non-root users, read-only root filesystems, dropped capabilities and keeping secrets out of images.

A larger part of the guide describes a hardened harness for testing command-line installers inside disposable containers. The agent is pointed at a Compose file for running installer checks against Debian and Ubuntu images on a read-only source mount, with a dry-run default, no network unless explicitly enabled, and no host credentials mounted. It also explains where Linux containers stop being useful, since macOS and Windows behavior must be checked natively on those hosts.

The guidance assumes Docker with the Compose plugin and a Linux host for the container steps. The installer examples reference a specific project's Compose file and npm scripts, so they apply to that repository rather than to arbitrary projects.

## When your agent uses it

> Docker and Docker Compose patterns for local development, hardened CLI installer harnesses, container security, networking, volumes, and multi-service orchestration. Use when creating or reviewing Dockerfiles and Compose services, testing installers across Linux distributions, or planning accurate native macOS and Windows validation.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/docker-patterns)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/docker-patterns)

## Features

- **Compose stack setup:** Templates for wiring an app with a database, cache and mail service into one Compose file with health checks.
- **Multi-stage Dockerfiles:** Patterns that split dependency, development, build and production stages into separate Dockerfile targets.
- **Container hardening:** Guidance on pinned tags, non-root users, read-only filesystems, dropped capabilities and secret handling.
- **Network and volume layout:** Examples of custom networks that isolate services and volume choices for persistent data and hot reload.
- **Isolated installer testing:** A harness pattern that runs installer checks in Linux containers against copies of a project with no network by default.
- **Debugging commands:** A quick reference of Compose commands for logs, shells, process inspection, resource use and DNS checks.

## Good for

- Set up a local Compose stack with Postgres and Redis for a web app
- Review a Dockerfile for non-root users, pinned tags and secret leakage
- Split a Dockerfile into dev and production stages
- Test a CLI installer across Debian and Ubuntu containers without touching the source checkout
- Work out which installer checks must run natively on macOS or Windows

## Install

### Claude Code

This skill ships in the `rea-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath
```

Or copy only this skill to `~/.claude/skills/docker-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/docker-patterns &&
cp -R "$tmp/.agents/skills/docker-patterns" ~/.claude/skills/docker-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/docker-patterns` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/docker-patterns` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/docker-patterns &&
cp -R "$tmp/.agents/skills/docker-patterns" ~/.agents/skills/docker-patterns &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/docker-patterns` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/docker-patterns` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/docker-patterns &&
cp -R "$tmp/.agents/skills/docker-patterns" ~/.cursor/skills/docker-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/docker-patterns` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/docker-patterns
```

Or copy the folder to `~/.gemini/skills/docker-patterns` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/docker-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/docker-patterns &&
cp -R "$tmp/.agents/skills/docker-patterns" ~/.copilot/skills/docker-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/docker-patterns` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git
```

Then copy `REA_Skill/.agents/skills/docker-patterns` into your agent's skills folder as `docker-patterns`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does Docker patterns need any scripts or tools installed?

It contains no scripts of its own. It assumes Docker with Compose is available, and the installer harness section relies on a project-specific Compose file and npm scripts.

### Can a Linux container validate macOS or Windows behavior?

No. The guide says Linux containers cannot validate macOS or Windows behavior, so those checks should run on native CI runners for each platform.

### When does the agent use Docker patterns?

According to its description, it applies when creating or reviewing Dockerfiles and Compose services, testing installers across Linux distributions, or planning native macOS and Windows validation.

### How do I install Docker patterns in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/docker-patterns to use it in all your projects, or to .claude/skills/docker-patterns in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

### Does Docker patterns run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Docker patterns?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Docker patterns?

The closest alternatives to Docker patterns are Deployment patterns, Gem devops guidelines, Containerize aspnetcore, Java testcontainers and Containerize aspnet framework.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Deployment patterns](https://ai-powered.com/skills/deployment-patterns): Deployment patterns is an open-source agent skill for cloud and infrastructure.
- [Gem devops guidelines](https://ai-powered.com/skills/gem-devops-guidelines): Gem devops guidelines is an open-source agent skill for cloud and infrastructure.
- [Containerize aspnetcore](https://ai-powered.com/skills/containerize-aspnetcore): Containerize aspnetcore is an open-source agent skill for developer tools.
- [Java testcontainers](https://ai-powered.com/skills/java-testcontainers): Java testcontainers is an open-source agent skill for developer tools.
- [Containerize aspnet framework](https://ai-powered.com/skills/containerize-aspnet-framework): Containerize aspnet framework is an open-source agent skill for developer tools.
- [Dmux workflows](https://ai-powered.com/skills/dmux-workflows): Dmux workflows is an open-source agent skill for developer tools.
- [Docker sandbox](https://ai-powered.com/skills/docker-sandbox): Docker sandbox is an open-source agent skill for developer tools.
- [Compose multiplatform patterns](https://ai-powered.com/skills/compose-multiplatform-patterns): Compose multiplatform patterns is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/docker-patterns
