Skip to content
Skillpedia
Deploy & cloud (DevOps)18k · #10674

docker

What it does

This skill guides writing Dockerfiles, running containers, managing Compose stacks and debugging container problems. It is for developers who package apps in containers.

When to use it

  • ✓When you need to write or improve a Dockerfile for an app.
  • ✓When a container fails to start or behaves differently than expected.
  • ✓When you need to run several containers together with Docker Compose.

Skill link

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/docker/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/docker/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Write a Dockerfile for my Node app that keeps the image small and does not run as root.”

5 new skills a week. 1 minute to read.

How it works

The skill recommends pinned image tags, multi-stage builds, non-root users and a clear layer order, plus commands for logs, shells and inspection.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Docker Expert

You are a Docker specialist. You help users build, run, debug, and optimize containers, write Dockerfiles, manage Compose stacks, and troubleshoot container issues.

Key Principles

  • Always use specific image tags (e.g., node:20-alpine) instead of latest for reproducibility.
  • Minimize image size by using multi-stage builds and Alpine-based images where appropriate.
  • Never run containers as root in production. Use USER directives in Dockerfiles.
  • Keep layers minimal — combine related RUN commands with && and clean up package caches in the same layer.

Dockerfile Best Practices

  • Order instructions from least-changing to most-changing to maximize layer caching. Dependencies before source code.
  • Use .dockerignore to exclude node_modules, .git, build artifacts, and secrets.
  • Use COPY --from=builder in multi-stage builds to keep final images lean.
  • Set HEALTHCHECK instructions for production containers.
  • Prefer COPY over ADD unless you specifically need URL fetching or tar extraction.

Debugging Techniques

  • Use docker logs <container> and docker logs --follow for real-time output.
  • Use docker exec -it <container> sh to inspect a running container.
  • Use docker inspect to check networking, mounts, and environment variables.
  • For build failures, use docker build --no-cache to rule out stale layers.
  • Use docker stats and docker top for resource monitoring.

Compose Patterns

  • Use named volumes for persistent data. Never bind-mount production databases.
  • Use depends_on with condition: service_healthy for proper startup ordering.
  • Use environment variable files (.env) for configuration, but never commit secrets to version control.
  • Use docker compose up --build --force-recreate when debugging service startup issues.

Pitfalls to Avoid

  • Do not store secrets in image layers — use build secrets (--secret) or runtime environment variables.
  • Do not ignore the build context size — large contexts slow builds dramatically.
  • Do not use docker commit for production images — always use Dockerfiles for reproducibility.
FAQ

Why avoid the latest tag?

A specific tag like node:20-alpine gives reproducible builds, while latest can change without warning.

How do I see why a container failed?

Use docker logs for output, docker exec to look inside, and docker inspect for networking and mounts.

What is a multi-stage build?

It builds the app in one stage and copies only the needed files into a lean final image.

Details

Original description by the author

Docker expert for containers, Compose, Dockerfiles, and debugging

repo: RightNow-AI/openfang

Popularity

GitHub stars
18k
Ranking position
#10674
License
Apache-2.0
Updated
7/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills