This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new bf07ce2665 GH-40443: [Python] Suppress 
python/examples/minimal_build/Dockerfile.* warnings (#40444)
bf07ce2665 is described below

commit bf07ce266511c6a2445f4b0fcd970e9d2e694431
Author: Sutou Kouhei <[email protected]>
AuthorDate: Mon Mar 11 10:48:27 2024 +0900

    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 <package>-<version>`.
        python/examples/minimal_build/Dockerfile.fedora:32 DL3042 warning: 
Avoid use of cache directory with pip. Use `pip install --no-cache-dir 
<package>`
        python/examples/minimal_build/Dockerfile.ubuntu:38 DL3042 warning: 
Avoid use of cache directory with pip. Use `pip install --no-cache-dir 
<package>`
    
    ### What changes are included in this PR?
    
    * Ignore "DL3041 warning: Specify version with `dnf install -y 
<package>-<version>`." 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 <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 .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 a6d7d03f84..6d326d7317 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 <package>-<version>`.
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d3c7624f63..917f9cc425 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 e7b9600b67..24a90337aa 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 e059c91017..ebea4b045e 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

Reply via email to