From bf07ce266511c6a2445f4b0fcd970e9d2e694431 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 11 Mar 2024 10:48:27 +0900 Subject: [PATCH] GH-40443: [Python] Suppress python/examples/minimal_build/Dockerfile.* warnings (#40444) ### Rationale for this change python/examples/minimal_build/Dockerfile.fedora:20 DL3040 warning: `dnf clean all` missing after dnf command. python/examples/minimal_build/Dockerfile.fedora:20 DL3041 warning: Specify version with `dnf install -y -`. python/examples/minimal_build/Dockerfile.fedora:32 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir ` python/examples/minimal_build/Dockerfile.ubuntu:38 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir ` ### What changes are included in this PR? * Ignore "DL3041 warning: Specify version with `dnf install -y -`." because we don't specify version. * Suppress other warnings. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #40443 Authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- .hadolint.yaml | 5 +++-- .pre-commit-config.yaml | 2 +- python/examples/minimal_build/Dockerfile.fedora | 5 +++-- python/examples/minimal_build/Dockerfile.ubuntu | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index a6d7d03f84f9e..6d326d7317ee3 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -18,7 +18,8 @@ ignored: - DL3008 - DL3013 + - DL3015 # Avoid additional packages by specifying `--no-install-recommends` - DL3018 - - DL3015 # Avoid additional packages by specifying `--no-install-recommends` - - DL3028 # Ruby gem version pinning + - DL3028 # Ruby gem version pinning - DL3007 # r-sanitizer must use latest + - DL3041 # Specify version with `dnf install -y -`. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3c7624f63e71..917f9cc425ae8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: name: Docker Format language: docker_image types: - - dockerfile + - dockerfile entry: --entrypoint /bin/hadolint hadolint/hadolint:latest - exclude: ^dev/.*$ - repo: https://github.com/pycqa/flake8 diff --git a/python/examples/minimal_build/Dockerfile.fedora b/python/examples/minimal_build/Dockerfile.fedora index e7b9600b67b0e..24a90337aa454 100644 --- a/python/examples/minimal_build/Dockerfile.fedora +++ b/python/examples/minimal_build/Dockerfile.fedora @@ -27,6 +27,7 @@ RUN dnf update -y && \ make \ cmake \ ninja-build \ - python3-devel + python3-devel && \ + dnf clean all -RUN pip3 install -U pip setuptools +RUN pip3 install --no-cache-dir -U pip setuptools diff --git a/python/examples/minimal_build/Dockerfile.ubuntu b/python/examples/minimal_build/Dockerfile.ubuntu index e059c91017f16..ebea4b045e592 100644 --- a/python/examples/minimal_build/Dockerfile.ubuntu +++ b/python/examples/minimal_build/Dockerfile.ubuntu @@ -35,4 +35,4 @@ RUN apt-get update -y -q && \ && \ apt-get clean && rm -rf /var/lib/apt/lists* -RUN pip3 install -U pip setuptools +RUN pip3 install --no-cache-dir -U pip setuptools