From e266ea760f98a34dd1be5996bf482c4af60dfcbc Mon Sep 17 00:00:00 2001 From: John Bampton Date: Tue, 12 Mar 2024 04:20:41 +1000 Subject: [PATCH] super-linter: validate the `Dockerfile` with `hadolint` https://github.com/super-linter/super-linter?tab=readme-ov-file#configure-super-linter https://github.com/hadolint/hadolint https://github.com/hadolint/hadolint?tab=readme-ov-file#configure https://github.com/hadolint/hadolint/wiki/DL3042 --- .github/linters/.hadolint.yaml | 4 ++++ .github/workflows/super-linter.yml | 1 + Dockerfile | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .github/linters/.hadolint.yaml diff --git a/.github/linters/.hadolint.yaml b/.github/linters/.hadolint.yaml new file mode 100644 index 000000000..b418cc387 --- /dev/null +++ b/.github/linters/.hadolint.yaml @@ -0,0 +1,4 @@ +failure-threshold: info +ignored: + - DL3008 # https://github.com/hadolint/hadolint/wiki/DL3008 + - DL3013 # https://github.com/hadolint/hadolint/wiki/DL3013 diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index ed63fbe36..be78055c0 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -24,6 +24,7 @@ jobs: env: VALIDATE_BASH: true # VALIDATE_BASH_EXEC: true + VALIDATE_DOCKERFILE_HADOLINT: true # VALIDATE_EDITORCONFIG: true VALIDATE_GITLEAKS: true # VALIDATE_SHELL_SHFMT: true diff --git a/Dockerfile b/Dockerfile index c4419b4f6..34936c937 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,6 @@ WORKDIR /app COPY Gemfile Gemfile.lock .pre-commit-config.yaml ./ -RUN bundle install && pip3 install pre-commit && git init . && pre-commit install-hooks +RUN bundle install && pip3 install --no-cache-dir pre-commit && git init . && pre-commit install-hooks COPY . .