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

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new e68a272c Refactor Dockerfile to streamline Apache RAT installation
e68a272c is described below

commit e68a272c3c631beca4514cde1eda9accf8c8c43e
Author: Dave Fisher <[email protected]>
AuthorDate: Mon Feb 23 11:14:22 2026 -0800

    Refactor Dockerfile to streamline Apache RAT installation
    
    Consolidate commands for downloading and extracting Apache RAT.
---
 Dockerfile.alpine | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Dockerfile.alpine b/Dockerfile.alpine
index 4fcacfb3..4c10596b 100644
--- a/Dockerfile.alpine
+++ b/Dockerfile.alpine
@@ -45,17 +45,17 @@ RUN apk update && \
 # install additional tools
 ENV RAT_VERSION=0.17
 
-RUN mkdir -p /opt/tools
-RUN mkdir -p /tmp/apache-rat
-WORKDIR /tmp/apache-rat
-# TODO: Check hash
-# TODO: This URL is not permanent, so we need to vendor this to pin it
-RUN curl -L 
https://dlcdn.apache.org/creadur/apache-rat-${RAT_VERSION}/apache-rat-${RAT_VERSION}-bin.tar.gz
 -o apache-rat.tar.gz
-RUN tar -xzf apache-rat.tar.gz
-RUN find apache-rat-${RAT_VERSION} -type f -name "*.jar" -exec cp {} . \;
-# Rename to match expected filename if needed
-RUN [ -f apache-rat-${RAT_VERSION}.jar ] || mv $(find . -maxdepth 1 -type f 
-name "apache-rat*.jar" | head -1) apache-rat-${RAT_VERSION}.jar
-RUN mv apache-rat-${RAT_VERSION}.jar /opt/tools
+RUN set -eux; \
+    mkdir -p /opt/tools /tmp/apache-rat; \
+    cd /tmp/apache-rat; \
+    curl -fsSLO 
https://dlcdn.apache.org/creadur/apache-rat-${RAT_VERSION}/apache-rat-${RAT_VERSION}-bin.tar.gz;
 \
+    curl -fsSLO 
https://downloads.apache.org/creadur/apache-rat-${RAT_VERSION}/apache-rat-${RAT_VERSION}-bin.tar.gz.sha512;
 \
+    test "$(sha512sum apache-rat-${RAT_VERSION}-bin.tar.gz | awk '{print 
$1}')" = \
+         "$(cat apache-rat-${RAT_VERSION}-bin.tar.gz.sha512)"; \
+    tar -xzf apache-rat-${RAT_VERSION}-bin.tar.gz; \
+    find apache-rat-${RAT_VERSION} -type f -name "*.jar" -exec cp {} . \; ; \
+    mv apache-rat-${RAT_VERSION}.jar /opt/tools; \
+    rm -rf /tmp/apache-rat
 
 # WORKDIR /var/run
 ENV SYFT_VERSION=1.38.2


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to