LayerLint
Dockerfile linter for Docker layer cache issues. Find cache-breaking COPY/deps patterns before they slow CI.
go install github.com/vviveksharma/layerLint/cmd/layerlint@latest
layerlint scan .
Rules
- Dependency install runs after broad source copy
- Dependency install without lockfile
- Unpinned base image tag
- Secrets copied into the image
- Container runs as root
- .dockerignore file is missing
- Build without BuildKit cache mount
- apt-get update separated from install
- Multiple broad COPY instructions
- Redundant dependency install
- ADD used instead of COPY
- Download without checksum verification
- Missing HEALTHCHECK instruction