Skip to main content
skill CX Codex

docker · mindrally — Claude Code skill: what it does, how to install

Establishes best practices for lean Docker images, multi-stage builds, container security, and Compose workflows.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill docker -a claude-code
Open on GitHub

What docker does

This skill guides coding agents on writing lean, isolated container setups. It enforces one process per container alongside official base images pinned to specific version tags. Floating tags like latest are out. To cut image footprints, the instructions demand multi-stage builds and cleaning package manager caches within the same RUN instruction.

Security guidelines require running containers under a non-root user. Resource limits for CPU and memory must be set. Baking secrets into images is strictly forbidden. For sensitive variables, the skill directs agents toward dedicated secrets management tools instead of environment variables.

For multi-container projects, the rules configure Docker Compose version 3+ setups with explicit networks and health-check dependencies. In continuous integration pipelines, images receive git commit SHA tags and undergo vulnerability scanning prior to registry deployment.

What it helps with

  • build minimal multi-stage Dockerfiles with separate build and runtime phases
  • configure Docker Compose version 3+ files with explicit networks and volume mounts
  • secure container execution with non-root users and read-only file systems
  • enforce health checks alongside CPU and memory limits
  • integrate automated image scanning and git SHA tagging into CI/CD pipelines

Example prompts for the agent

  • Write a multi-stage Dockerfile for a Python API running as non-root
  • Create a Docker Compose v3 configuration with explicit bridge networks and health checks
  • Audit my Dockerfile layers and generate an optimized .dockerignore file

How to install docker

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill docker -a claude-code

2Manually: put the files in place

~/.claude/skills/docker/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/docker/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about docker

How to install docker in Claude Code?

Run npx skills add Mindrally/skills --skill docker -a claude-code or place the file directly at ~/.claude/skills/docker/SKILL.md.

What does the docker skill do?

It provides containerization guidelines covering multi-stage builds, non-root user security, layer cache optimization, and Docker Compose version 3+ workflows.

How does this skill handle credentials and sensitive data?

The instructions forbid embedding secrets in image layers or storing them in plain environment variables, requiring a secrets manager instead.

Source text

SKILL.md · Apache-2.0
---
name: docker
description: Docker containerization best practices for building, securing, and deploying containers.
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Docker Development

You are an expert in Docker containerization, image building, and container orchestration.

## Core Principles

- Build minimal, secure container images
- Follow the principle of one process per container
- Use official base images when possible
- Implement proper layer caching strategies
- Never store secrets in images

## Dockerfile Best Practices

### Multi-Stage Builds
- Use multi-stage builds to reduce image size
- Separate build and runtime stages
- Copy only necessary artifacts to final image

### Layer Optimization
- Order instructions from least to most frequently changing
- Combine RUN commands to reduce layers
- Use .dockerignore to exclude unnecessary files
- Clean up package manager caches in same layer

### Base Images
- Use specific version tags, not `latest`
- Prefer slim or alpine variants for smaller size
- Scan base images for vulnerabilities
- Consider distroless images for production

## Security Best Practices

- Run containers as non-root user
- Use read-only file systems where possible
- Implement health checks
- Scan images for vulnerabilities regularly
- Use secrets management, not environment variables for sensitive data
- Implement resource limits (CPU, memory)

## Docker Compose

### Configuration
- Use version 3+ compose files
- Define networks explicitly
- Use volumes for persistent data
- Implement depends_on with health checks
- Use environment files for configuration

### Development Workflow
- Mount source code for hot reloading
- Use override files for environment-specific config
- Implement proper logging drivers
- Use build args for build-time variables

## CI/CD Integration

- Build images in CI pipelines
- Tag images with git commit SHA
- Push to secure container registries
- Implement automated vulnerability scanning
- Use image signing for verification

## Networking

- Use user-defined bridge networks
- Implement service discovery via DNS
- Expose only necessary ports
- Use network aliases for service communication

## Logging and Monitoring

- Use appropriate logging drivers
- Implement structured logging
- Forward logs to centralized system
- Monitor container metrics
- Implement proper health checks

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

All skills for DevOps and infrastructure →

docker by other authors comes first.

docker codewithmukesh Configures Docker containerization for .NET 10 apps with multi-stage builds, non-root user setup, and orchestrator-level health probes. CX Codex +1 2,900installs docker bobmatnyc A Docker skill that helps your agent write Dockerfiles, build images and run services with Compose. Useful when the same app has to behave the same in dev and production. CX Codex +1 1,000installs wizard Matt Pocock This skill creates an interactive bash wizard for manual setup steps, CI secrets, third-party dashboards, and one-off migrations. 553,369installs hyperframes-cli heygen-com Controls HyperFrames video workflows from the CLI: audits layouts and contrast, edits timeline clips, captures snapshots, and renders locally or in cloud runtimes. CX Codex +1 1,300,000installs setup-pre-commit Matt Pocock This skill configures pre-commit checks for a JavaScript repository, running Prettier, type checking, and tests before each commit. 489,289installs using-git-worktrees Jesse Vincent Prepares an isolated workspace before feature work or plan execution. It checks the repository first, then uses native worktree support or Git. CX Codex 217,153installs finishing-a-development-branch Jesse Vincent This skill checks the test suite and guides branch completion: merge locally, open a Pull Request, or leave the work in place. CX Codex 214,439installs orca-cli stablyai The skill lets an agent manage Orca worktrees, terminals, artifacts and the built-in browser through the orca CLI. Useful when your work already runs inside Orca. CX Codex +1 353,600installs

From the same set214

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor