chia7712 commented on code in PR #18844:
URL: https://github.com/apache/kafka/pull/18844#discussion_r1961613921


##########
docker/native/Dockerfile:
##########
@@ -31,13 +33,23 @@ COPY native_command.sh native_command.sh
 
 RUN mkdir $KAFKA_DIR; \
     microdnf install wget; \
+    if [ "$SKIP_SIGNING" = "false" ]; then \

Review Comment:
   we can use `skip_signing` directly



##########
docker/native/Dockerfile:
##########
@@ -16,10 +16,12 @@
 FROM ghcr.io/graalvm/graalvm-community:21 AS build-native-image
 
 ARG kafka_url
+ARG skip_signing

Review Comment:
   please add "false" as default value



##########
docker/native/Dockerfile:
##########
@@ -31,13 +33,23 @@ COPY native_command.sh native_command.sh
 
 RUN mkdir $KAFKA_DIR; \
     microdnf install wget; \
+    if [ "$SKIP_SIGNING" = "false" ]; then \
+        microdnf install gpg; \
+    fi; \
     wget -nv -O kafka.tgz "$KAFKA_URL"; \
-    wget -nv -O kafka.tgz.asc "$KAFKA_URL.asc"; \
+    if [ "$SKIP_SIGNING" = "false" ]; then \
+        wget -nv -O kafka.tgz.asc "$KAFKA_URL.asc"; \
+        wget -nv -O KEYS https://downloads.apache.org/kafka/KEYS; \
+        gpg --import KEYS; \
+        gpg --batch --verify kafka.tgz.asc kafka.tgz; \
+    fi; \
     tar xfz kafka.tgz -C $KAFKA_DIR --strip-components 1; \
-    wget -nv -O KEYS https://downloads.apache.org/kafka/KEYS; \
-    gpg --import KEYS; \
-    gpg --batch --verify kafka.tgz.asc kafka.tgz; \
-    rm kafka.tgz ; \
+    rm kafka.tgz; \
+    if [ "$SKIP_SIGNING" = "false" ]; then \
+        rm kafka.tgz.asc KEYS; \
+        microdnf remove gpg; \
+    fi; \
+    microdnf remove wget; \

Review Comment:
   ditto



##########
docker/jvm/Dockerfile:
##########
@@ -51,7 +55,7 @@ USER root
 # Get kafka from https://archive.apache.org/dist/kafka and pass the url 
through build arguments
 ARG kafka_url
 ARG build_date
-
+ARG skip_signing

Review Comment:
   ditto



##########
docker/native/Dockerfile:
##########
@@ -31,13 +33,23 @@ COPY native_command.sh native_command.sh
 
 RUN mkdir $KAFKA_DIR; \
     microdnf install wget; \
+    if [ "$SKIP_SIGNING" = "false" ]; then \
+        microdnf install gpg; \
+    fi; \
     wget -nv -O kafka.tgz "$KAFKA_URL"; \
-    wget -nv -O kafka.tgz.asc "$KAFKA_URL.asc"; \
+    if [ "$SKIP_SIGNING" = "false" ]; then \
+        wget -nv -O kafka.tgz.asc "$KAFKA_URL.asc"; \
+        wget -nv -O KEYS https://downloads.apache.org/kafka/KEYS; \
+        gpg --import KEYS; \
+        gpg --batch --verify kafka.tgz.asc kafka.tgz; \
+    fi; \
     tar xfz kafka.tgz -C $KAFKA_DIR --strip-components 1; \
-    wget -nv -O KEYS https://downloads.apache.org/kafka/KEYS; \
-    gpg --import KEYS; \
-    gpg --batch --verify kafka.tgz.asc kafka.tgz; \
-    rm kafka.tgz ; \
+    rm kafka.tgz; \
+    if [ "$SKIP_SIGNING" = "false" ]; then \
+        rm kafka.tgz.asc KEYS; \

Review Comment:
   we can move this to line#45



##########
docker/jvm/jsa_launch:
##########
@@ -17,9 +17,9 @@
 KAFKA_CLUSTER_ID="$(opt/kafka/bin/kafka-storage.sh random-uuid)"
 TOPIC="test-topic"
 
-KAFKA_JVM_PERFORMANCE_OPTS="-XX:ArchiveClassesAtExit=storage.jsa" 
opt/kafka/bin/kafka-storage.sh format --standalone -t $KAFKA_CLUSTER_ID -c 
opt/kafka/config/server.properties
+KAFKA_JVM_PERFORMANCE_OPTS="-XX:ArchiveClassesAtExit=storage.jsa" 
opt/kafka/bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c 
/etc/kafka/docker/server.properties

Review Comment:
   this script is used to generate jsa file, so it can keep using standalone 
mode, right?



##########
docker/jvm/Dockerfile:
##########
@@ -62,14 +66,19 @@ LABEL org.label-schema.name="kafka" \
 RUN set -eux ; \
     apk update ; \
     apk upgrade ; \
-    apk add --no-cache wget gcompat gpg gpg-agent procps bash; \
+    apk add --no-cache wget gcompat procps bash; \
+    if [ "$skip_signing" = "false" ]; then \
+        apk add --no-cache gpg gpg-agent; \
+    fi; \
     mkdir opt/kafka; \
     wget -nv -O kafka.tgz "$kafka_url"; \
-    wget -nv -O kafka.tgz.asc "$kafka_url.asc"; \
+    if [ "$skip_signing" = "false" ]; then \

Review Comment:
   BTW, could you please consider using `"$skip_signing" != "true"` which can 
run gpg check by default.



##########
docker/native/Dockerfile:
##########
@@ -31,13 +33,23 @@ COPY native_command.sh native_command.sh
 
 RUN mkdir $KAFKA_DIR; \
     microdnf install wget; \
+    if [ "$SKIP_SIGNING" = "false" ]; then \
+        microdnf install gpg; \
+    fi; \
     wget -nv -O kafka.tgz "$KAFKA_URL"; \
-    wget -nv -O kafka.tgz.asc "$KAFKA_URL.asc"; \
+    if [ "$SKIP_SIGNING" = "false" ]; then \
+        wget -nv -O kafka.tgz.asc "$KAFKA_URL.asc"; \
+        wget -nv -O KEYS https://downloads.apache.org/kafka/KEYS; \
+        gpg --import KEYS; \
+        gpg --batch --verify kafka.tgz.asc kafka.tgz; \
+    fi; \
     tar xfz kafka.tgz -C $KAFKA_DIR --strip-components 1; \
-    wget -nv -O KEYS https://downloads.apache.org/kafka/KEYS; \
-    gpg --import KEYS; \
-    gpg --batch --verify kafka.tgz.asc kafka.tgz; \
-    rm kafka.tgz ; \
+    rm kafka.tgz; \
+    if [ "$SKIP_SIGNING" = "false" ]; then \
+        rm kafka.tgz.asc KEYS; \
+        microdnf remove gpg; \

Review Comment:
   why do add this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to