diff --git a/.hadolint.yaml b/.hadolint.yaml index 818a2fbec0..db374abb08 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,9 +1,9 @@ ignored: - # Pin versions in apt-get install. + # Pin versions in `apt-get install`. # Reason: Identifying the versions of apt packages is not trivial. The versions available would # also differ for different base images. This decision should be re-evaluated periodically. - DL3008 - # Pin versions in apt get install. + # Pin versions in `apk add`. # Reason: Identifying the versions of apk packages is not trivial. The versions available would # also differ for different base images. This decision should be re-evaluated periodically. - DL3018 diff --git a/lint-staged.config.js b/lint-staged.config.js index de697c88d8..5c36631184 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -19,4 +19,9 @@ module.exports = { // Lint the projects affected by the staged files `nx affected --target=lint --files=${filenames.join(',')}`, ], + + '**/*[dD]ockerfile*': (filenames) => [ + // Lint Dockerfiles with Hadolint + `hadolint ${filenames.join(' ')}`, + ], }; diff --git a/tools/devcontainers/sage/.devcontainer/Dockerfile b/tools/devcontainers/sage/.devcontainer/Dockerfile index ed6f31aa57..4f28f194a9 100644 --- a/tools/devcontainers/sage/.devcontainer/Dockerfile +++ b/tools/devcontainers/sage/.devcontainer/Dockerfile @@ -43,7 +43,6 @@ ENV DEVCONTAINER_VERSION=${devcontainerVersion} \ LC_ALL=en_US.UTF-8 # Install system packages -# hadolint ignore=DL3008 RUN apt-get update -qq -y && export DEBIAN_FRONTEND=noninteractive \ && apt-get install --no-install-recommends -qq -y \ ca-certificates curl git bash-completion gnupg2 lsb-release ssh sudo \