docker

Review and write Dockerfiles and Docker Compose files for security and efficiency best practices.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/westonwrz/codex-skills-by-codex --skill docker-westonwrz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: docker
Source: https://github.com/westonwrz/codex-skills-by-codex/tree/main/docker
Command: npx skills add https://github.com/westonwrz/codex-skills-by-codex --skill docker-westonwrz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and agents (resource) components.

What problem does it solve?

This Skill helps you write, review, and optimize Dockerfiles and Docker Compose files, ensuring your container builds are secure, efficient, and maintainable.

Core Features & Use Cases

  • Dockerfile Best Practices: Guides on base image selection, multi-stage builds, layer hygiene, and security.
  • Docker Compose Optimization: Recommendations for networking, secrets management, resource limits, and healthchecks.
  • Use Case: You need to create a Dockerfile for a new microservice. This Skill will guide you through best practices for security and efficiency, helping you choose the right base image, set up non-root users, and optimize build layers.

Quick Start

Use the docker skill to review the provided Dockerfile for security and efficiency best practices.

Frequently Asked Questions about docker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize a Dockerfile for security and build efficiency?▼

To optimize a Dockerfile for security and efficiency, use multi-stage builds, select minimal base images, maintain proper layer hygiene, and configure non-root users to reduce attack surface and cache redundant steps.

What are the best practices for managing secrets in Docker Compose?▼

Best practices for Docker Compose secrets management involve using dedicated secrets definitions rather than environment variables, alongside configured resource limits and healthchecks to secure multi-service setups.

How do I review an existing Dockerfile for common security issues?▼

Reviewing a Dockerfile for security involves checking base image selection, verifying non-root user implementation, analyzing layer hygiene, and ensuring proper secret management to eliminate vulnerabilities during container builds.

Can I use Docker Compose to configure healthchecks and resource limits for multi-service setups?▼

Yes, Docker Compose supports configuring healthchecks and resource limits for multi-service setups, allowing you to define networking rules and manage secrets to ensure maintainable and stable container orchestration.

What is the best way to structure Dockerfile instructions to improve build cache performance?▼

The best way to improve Dockerfile build cache performance is ordering instructions from least to most frequently changing, utilizing multi-stage builds to isolate dependencies, and maintaining strict layer hygiene.

Why does my Docker image build have too many layers and slow performance?▼

Docker image builds accumulate excessive layers and slow performance when instructions are unoptimized; combining commands, applying multi-stage builds, and enforcing layer hygiene resolves these inefficiencies.