docker

Automate secure Docker image creation with multi-stage builds and OCI labels.

Updated Jan 29, 2026
One-click install
npx skills add https://github.com/yldgio/codereview-skills --skill docker-yldgio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker
Source: https://github.com/yldgio/codereview-skills/tree/main/skills/docker
Command: npx skills add https://github.com/yldgio/codereview-skills --skill docker-yldgio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Dockerfile development often results in insecure defaults, bloated images, and brittle builds. This Skill provides guidance to enforce security, efficiency, and maintainability in Dockerfile authoring and image creation.

Core Features & Use Cases

  • Security hardening: non-root users, minimal base images, and image scanning integration.
  • Build optimization: multi-stage builds, reduced layers, and cached layer ordering.
  • Observability and metadata: OCI-compliant labels and documentation within images.
  • CI/CD readiness: reproducible builds and best practices for automated pipelines.

Quick Start

Apply these practices to your Dockerfiles: enable a non-root user, switch to a minimal base image, implement a multi-stage build, add OCI labels, and include a health check for your container. Then integrate image scanning in your CI pipeline.

Frequently Asked Questions about docker

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

FAQPage Schema
How do I create secure and lean Docker images for production?

To create secure and lean Docker images, implement multi-stage builds, use minimal base images, configure non-root execution, and add OCI-compliant labels to enforce security and efficiency standards.

What is a multi-stage build in Docker and why do I need it?

A multi-stage build is a Docker technique that reduces final image size and bloat by compiling artifacts in one stage and copying only the necessary outputs to a minimal final stage.

Does this Docker image optimization approach work for CI/CD pipelines?

Yes, this approach works for CI/CD pipelines by enforcing reproducible builds, cached layer ordering, and automated image scanning to ensure reliable and auditable automated deployments.

What's the best way to harden container security for my applications?

The best way to harden container security is by enforcing non-root users, minimizing base images, and integrating image scanning directly into your build and deployment pipelines.

Why are my Docker images so bloated and how can I reduce layer size?

Docker images become bloated due to unnecessary dependencies and unoptimized layers; you can reduce size by ordering cached layers efficiently and implementing multi-stage builds.