hadolint

A linter for Dockerfiles that flags risky or sloppy instructions, such as running as root or using an unpinned latest tag.

In more detail

Each finding has a rule code: DL3002 means the last USER is root, and DL3007 means an image uses the latest tag. It also runs ShellCheck on the commands inside RUN lines. Running it in the pipeline catches these problems before an image is built.

Example

hadolint Dockerfile

Related terms

Taught in

References

Certification courses