Code Monkey home page Code Monkey logo

Comments (3)

szepeviktor avatar szepeviktor commented on June 20, 2024

Could it be the reason that there is no Dockerfile in the root of the project?

from hadolint-action.

gnzsnz avatar gnzsnz commented on June 20, 2024

Same issue here

my .pre-commit.yaml file

repos:
  - repo: https://github.com/hadolint/hadolint
    rev: v2.12.0
    hooks:
      - id: hadolint-docker

output

Lint Dockerfiles.........................................................Failed
- hook id: hadolint-docker
- exit code: 1

hadolint: Dockerfile.template: withBinaryFile: does not exist (No such file or directory)
hadolint: latest/Dockerfile.tws: withBinaryFile: does not exist (No such file or directory)

The files stated on the output are there, and the linter can find them. however it fails.

If I change my pre-commit config file to

repos:
  - repo: https://github.com/hadolint/hadolint
    rev: v2.12.0
    hooks:
      - id: hadolint

it works fine

from hadolint-action.

nvtkaszpir avatar nvtkaszpir commented on June 20, 2024

I've seen this when there is no Dockerfile in the repo in any directory or subdirectory.
This usually happens when the repo is fresh (no Dockerfile yet) or if the Dockerfiles were deleted in the commit.
The first one is quite obvious, but the second one means that github action is executed when the files were deleted and actually step should be skipped.

So this Github Action should be patched to support this, I do not have solution for it.

Yet if anyone is interested I can provide custom GitHub workflow that handles the case (skip action if no Dockerfiles are changed or are deleted). If someone is interested I can get it next week.
With proper github action workflow in the script it would probably take a bit more time, but is also doable.

from hadolint-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.