Can't install hadolint on Ubuntu with WSL 2

Viewed 638

I'm trying to install hadolint to use with docker on a Ubuntu app for Windows with WSL.

Heres how I installed:

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

and when I ran (on a directory with an Dockerfile):

sudo make lint Dockerfile

and here's the error I'm getting:

# See local hadolint install instructions:   https://github.com/hadolint/hadolint
# This is linter for Dockerfiles
hadolint Dockerfile
make: execvp: hadolint: Permission denied
Makefile:24: recipe for target 'lint' failed
make: *** [lint] Error 127enter code here

I new at Linux and I don't know if there's enough information to help me solve this.

Here's some link's I've looked up.

How to install hadolint on Ubuntu

https://github.com/LIMXTEC/BitCore/issues/26

https://github.com/hadolint/hadolint

And none of them helped me to solve.

1 Answers

If you want to use the local binary, all you need to do is to grant it the execution permission:

chmod +x /bin/hadolint

Hence you are in the Docker business anyway, you can alternatively use a hadolint container to get the job done:

docker run --rm -i hadolint/hadolint < Dockerfile

where Dockerfile is the file you want to lint.

Related