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:

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
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.