Docker

Accelerate how you build, share, and run applications Use when this capability is needed.

tomevault-io Updated

File contents

Docker Skill

Best Practices

  1. Multi-Stage Builds: Use a builder stage to compile, and a runner stage (Alpine/Slim) for the final image to reduce size.
  2. Caching: Order usage matters. Copy package.json and install deps BEFORE copying source code to leverage layer caching.
  3. User: Don't run as root. Create a dedicated user in the Dockerfile.

Common Pitfalls

  • Secrets: Baking secrets/env vars into the image. Use Env Vars at runtime.
  • Latest Tag: Pin versions (node:18, not node:latest) to avoid breaking changes.

References


Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/sami--widgets--docker commit 129de2f7c5

Frequently asked questions

npx skillmds@latest add tomevault-io/docker