hadolint / hadolint-action

GitHub action for Hadolint, A Dockerfile linting tool
MIT License
194 stars 52 forks source link

Fails on self-hosted runners #7

Closed aqabawe closed 3 years ago

aqabawe commented 4 years ago

The same workflow runs fine on ubuntu-latest, but fails with hadolint: Dockerfile: openBinaryFile: does not exist (No such file or directory) on our self-hosted runner, any thoughts?

brpaz commented 3 years ago

Sorry. I have no idea. :disappointed:

I have seen that error somewhere before but can´t remember what was the issue.

Maybe there is some package or different configuration on the self-hosted runners that results in this error.

agners commented 3 years ago

Runs for me on a self-hosted runner. I initially had the same error message but realized I forgot to include a checkout step :see_no_evil:

....
    steps:
    - name: Check out code
      uses: actions/checkout@v1
    - uses: brpaz/hadolint-action@v1.1.0
      with:
        dockerfile: Dockerfile
brpaz commented 3 years ago

@aqabawe If you still have this problem, please see @agners comment. I will close this issue for now. Feel free to reopen.

brandysnaps commented 3 years ago

I ran into this issue today when trying to run hadolint on a self-hosted runner. I use a custom working directory which works fine for my other linting jobs, but not hadolint. Not sure if hadolint is ignoring the working-directory option.

Working directory configuration:

defaults:
  run:
    working-directory: my-custom-dir

Failing action configuration:

- name: Lint with hadolint
  uses: hadolint/hadolint-action@v1.5.0
  with:
    dockerfile: Dockerfile

Successful job configuration:

- name: Lint with hadolint
  uses: hadolint/hadolint-action@v1.5.0
  with:
    dockerfile: my-custom-dir/Dockerfile
kayman-mk commented 2 years ago

Just had the same problem. The reason was, that the file to check did not exist.

sinabehmanesh commented 4 months ago

Hadolint should be looking for Dockerfiles, if it finds any then that dockerfile should be checked. how does it know that it should be looking for a specific file and then it does not find it, it should fail? am I missing smth?