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


##########
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:
   since the version has to match `snappy.version` in the maven build, I think 
it would be useful to pass it as an argument to the build. for example `ARG 
SNAPPY_VERSION=1.1.10.5` in the Dockerfile and then passing `snappy.version` to 
that argument in the maven build that builds the docker image.



-- 
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