How to install hadolint on linux

Hadolint is linter for Dockerfiles, it is checking if dockerfile has correct syntax (and that dockerfile is compliant with other defined rules)

Rules are defined below:
https://github.com/hadolint/hadolint

Easiest way how to make hadolint work is just to download the executable and put is in your /bin directory (download the newest version from official hadolint github)

sudo wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64
sudo chmod +x /bin/hadolint

Then we can start checking syntax of our dockerfile:

/bin/hadolint Dockerfile

For convenience we can also create an alias in our .bashrc file so we dont have to remeber full path to the binary.

Source: