Dockerfile Linter — Pin Images, Catch Risky RUN

Dockerfile Linter — Pin Images, Catch Risky RUN

Catch risky Dockerfile patterns before build.
#Ingenieurwesen
Rating
Weitere Bewertungen erforderlich
Sold
0
How to use
Herunterladen

Lint Dockerfiles offline before build — no image build, no image pull.

What it checks (7 rules):

  • Unpinned or :latest base images (unpinned-base, latest-tag)
  • RUN lines that pipe a download into a shell (download-to-shell)
  • apt-get install without cache cleanup, and apt-get update without install in the same layer (apt-no-cleanup, apt-update-alone)
  • ADD used where COPY would do (add-not-copy)
  • Images with no USER instruction, running as root by default (no-user)

Results: deterministic pass/fail, critical vs warning severities, CI-friendly exit codes, JSON and Markdown reports. Reports never copy instruction bodies.

Evidence: 7 automated tests, verified on real Dockerfile inputs before listing. Python 3.9+, no external dependencies.

Honest limits: does not build or run images, does not check whether a base image or package exists, does not scan for known vulnerabilities. Digest-pinned and scratch bases are accepted as pinned.

Part of the Safety Gate family — also see GitHub Actions Workflow Linter.