# Docker > Accelerate how you build, share, and run applications - Author: Sami Bashraheel - Repository: sami/widgets - Version: 20260202184028 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/sami/widgets - Web: https://mule.run/skillshub/@@sami/widgets~Docker:20260202184028 --- --- name: Docker description: Accelerate how you build, share, and run applications --- # 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 * [Dockerfile Best Practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/)