Skip to content

Commit b2aa3b5

Browse files
Build libsodium from source in Dockerfile.jvm.
1 parent e6a9a26 commit b2aa3b5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/main/docker/Dockerfile.jvm

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,26 @@
7878
# accessed directly. (example: "foo.example.com,bar.example.com")
7979
#
8080
###
81+
FROM registry.access.redhat.com/ubi9/openjdk-17:1.21 AS builder
82+
83+
USER 0
84+
ADD https://download.libsodium.org/libsodium/releases/libsodium-1.0.20.tar.gz libsodium-1.0.20.tar.gz
85+
86+
# Check with precomputed checksum(sha256sum libsodium-1.0.20.tar.gz)
87+
RUN echo "ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19 libsodium-1.0.20.tar.gz" | sha256sum -c -
88+
89+
RUN microdnf install -y gcc make autoconf automake libtool gzip && \
90+
tar -xzf libsodium-1.0.20.tar.gz && \
91+
cd libsodium-1.0.20 && ./configure && make && make install
92+
8193
FROM registry.access.redhat.com/ubi9/openjdk-17:1.21
8294

8395
ENV LANGUAGE='en_US:en'
8496

8597
USER 0
86-
RUN dnf install -y libsodium && dnf clean all
98+
COPY --from=builder /usr/local/lib/libsodium.so* /usr/local/lib/
99+
COPY --from=builder /usr/local/include/sodium/ /usr/local/include/sodium/
100+
RUN ldconfig
87101

88102
# We make four distinct layers so if there are application changes the library layers can be re-used
89103
COPY --chown=185 build/quarkus-app/lib/ /deployments/lib/
@@ -97,4 +111,3 @@ ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=or
97111
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
98112

99113
ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]
100-

0 commit comments

Comments
 (0)