lhotari commented on code in PR #22804:
URL: https://github.com/apache/pulsar/pull/22804#discussion_r1621232251


##########
docker/pulsar/Dockerfile:
##########
@@ -61,6 +61,16 @@ RUN /usr/lib/jvm/default-jvm/bin/jlink --add-modules 
ALL-MODULE-PATH --compress
 RUN echo networkaddress.cache.ttl=1 >> /opt/jvm/conf/security/java.security
 RUN echo networkaddress.cache.negative.ttl=1 >> 
/opt/jvm/conf/security/java.security
 
+## Create one stage to include snappy-java native lib
+# Fix the issue when using snappy-java in x86 arch alpine
+# See https://github.com/xerial/snappy-java/issues/181 
https://github.com/xerial/snappy-java/issues/579
+# We need to ensure that the version of the native library matches the version 
of snappy-java imported via Maven
+FROM alpine AS snappy-java
+
+RUN apk add git alpine-sdk util-linux cmake autoconf automake libtool 
openjdk17 maven curl bash
+ENV JAVA_HOME=/usr
+RUN git clone https://github.com/xerial/snappy-java.git
+RUN cd snappy-java && git checkout v1.1.10.5 && make clean-native native

Review Comment:
   instead of using `git clone`, I think it's better to use the `.tar.gz` 
provided by GitHub. Something like
   ```
   ARG SNAPPY_VERSION=1.1.10.5
   ...
   RUN curl -Ls 
https://github.com/xerial/snappy-java/archive/refs/tags/v$SNAPPY_VERSION.tar.gz 
| tar zxf - && cd snappy-java-$SNAPPY_VERSION && make clean-native native
   ```
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to