docker

Generate secure Dockerfiles with multi-stage builds and non-root execution.

2|Updated Mar 15, 2025
One-click install
npx skills add https://github.com/dandudzi/dotfiles --skill docker-dandudzi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker
Source: https://github.com/dandudzi/dotfiles/tree/main/dot_claude/skills/docker
Command: npx skills add https://github.com/dandudzi/dotfiles --skill docker-dandudzi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive patterns and best practices for building, securing, and orchestrating Docker containers, enabling robust local development and production-ready deployments.

Core Features & Use Cases

  • Docker Compose: Define and manage multi-container applications for local development.
  • Dockerfile Best Practices: Optimize images for size, security, and build speed using multi-stage builds and BuildKit.
  • Container Security: Implement non-root users, minimal base images, secrets management, vulnerability scanning, and image signing.
  • Use Case: Set up a local development environment for a web application with a database and cache using Docker Compose, ensuring the application container runs as a non-root user and its dependencies are securely managed.

Quick Start

Use the docker skill to generate a secure Dockerfile for a Node.js application that runs as a non-root user.

Frequently Asked Questions about docker

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

FAQPage Schema
How do I create a Dockerfile that runs a container as a non-root user?

Define a dedicated non-root user in your Dockerfile and switch to it using the USER instruction. This Skill provides secure containerization patterns to enforce least privilege and reduce attack surface in production.

What is the best way to optimize Docker images for size and build speed?

Use multi-stage builds and BuildKit to optimize Docker images for size and build speed. This Skill provides Dockerfile best practices that leverage layer caching and minimal base images to accelerate build times.

Does Docker Compose support managing secrets for local development environments?

Docker Compose supports secrets management to securely handle sensitive data like database credentials during local development. This Skill covers orchestration patterns including secrets handling and secure dependency management.

How do I manage vulnerability scanning and image signing for production containers?

Manage vulnerabilities by scanning images for known issues and signing them to verify integrity before deployment. This Skill provides runtime security configurations and vulnerability management patterns for production containers.

Can I use Docker Compose to orchestrate a web app with a database and cache?

You can use Docker Compose to define and manage multi-container applications like a web app with a database and cache. This Skill provides orchestration patterns for setting up robust local development environments.