πŸ› οΈ Developer Tools
Β· 3 min read

Free Dockerfile Linter


Paste your Dockerfile to get instant best-practice warnings and suggestions.

What This Linter Checks

  • Security: Running as root, secrets in ENV, privileged ports
  • Image size: Base image choice, apt cache cleanup, pip cache, multi-stage builds
  • Best practices: COPY vs ADD, npm ci vs npm install, .dockerignore, HEALTHCHECK
  • Common mistakes: Missing WORKDIR, latest tag, combining RUN layers

Dockerfile Best Practices

# βœ… Good Dockerfile
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
USER node
EXPOSE 3000
HEALTHCHECK --interval=30s CMD curl -f http://localhost:3000/ || exit 1
CMD ["node", "dist/server.js"]
πŸ“˜