Skip to content

Commit 4aa51ca

Browse files
committed
Attempt to replace Netty jars with ARM compatible ones
1 parent e31a0cd commit 4aa51ca

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

dse/Dockerfile-dse6.9.jdk11

+17
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
ARG DSE_VERSION=6.9.7
55
ARG DS_BASE_DEBIAN=ds-base-ubuntu-openjdk-11
66
ARG BASETAG=11.0.22-jdk-ubuntu-20240427
7+
FROM --platform=$BUILDPLATFORM maven:3.8.6-openjdk-11-slim AS netty-setup
8+
COPY settings.xml /root/.m2/settings.xml
9+
RUN set -x \
10+
&& mvn dependency:get -Dartifact=io.netty:netty-all:4.1.100.2.dse \
11+
&& mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-epoll:4.1.100.2.dse \
12+
&& mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-epoll:4.1.100.2.dse:jar:linux-x86_64 \
13+
&& mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-epoll:4.1.100.2.dse:jar:linux-aarch_64 \
14+
&& mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-kqueue:4.1.100.2.dse \
15+
## The artifacts below don't seem to be present yet, we'll need them for ARM images to work on OSX
16+
# && mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-kqueue:4.1.100.2.dse:jar:osx-x86_64 \
17+
# && mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-kqueue:4.1.100.2.dse:jar:osx-aarch_64 \
18+
&& mkdir /netty \
19+
&& find ~/.m2/repository/io/netty -type f -name "netty*4.1.100.2.dse*.jar" -exec cp {} /netty/ \;
20+
721
FROM datastax/${DS_BASE_DEBIAN}:${BASETAG} AS dse-server-prep
822

923
# Set up configuration variables
@@ -26,6 +40,8 @@ RUN set -x \
2640
&& mkdir -p "$DSE_HOME" \
2741
&& tar -C "$DSE_HOME" --strip-components=1 -xzf /${TARBALL} \
2842
&& rm /${TARBALL} \
43+
# Replace Netty with ARM compatible version
44+
&& find ${DSE_HOME}/resources/cassandra/lib/ -type f -name "netty*" -exec rm {} \; \
2945
# Unpack Agent tarball
3046
&& mkdir -p "$DSE_AGENT_HOME" \
3147
&& tar -C "$DSE_AGENT_HOME" --strip-components=1 -xzf /${DSE_AGENT_TARBALL} \
@@ -35,6 +51,7 @@ RUN set -x \
3551
&& apt-get install -y --install-recommends rdfind \
3652
&& rdfind -makehardlinks true -makeresultsfile false ${DSE_HOME} \
3753
&& chmod -R g+w ${DSE_HOME} ${DSE_AGENT_HOME}
54+
COPY --chown=dse:root --from=netty-setup /netty ${DSE_HOME}/resources/cassandra/lib/
3855

3956
#############################################################
4057

dse/Dockerfile-dse6.9.ubi8

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@ ARG UBI_MAJOR=8
33
ARG UBI_BASETAG=latest
44
ARG DSE_BASE_IMAGE=datastax/dse-mgmtapi-6_8:${DSE_VERSION}-jdk11
55

6-
FROM ${DSE_BASE_IMAGE} AS dse-server-base
6+
FROM --platform=$BUILDPLATFORM ${DSE_BASE_IMAGE} AS dse-server-base-amd64
7+
ENV DSE_HOME=/opt/dse
8+
RUN set -x \
9+
&& rm ${DSE_HOME}/resources/cassandra/lib/netty*aarch*
10+
11+
FROM --platform=$BUILDPLATFORM ${DSE_BASE_IMAGE} AS dse-server-base-arm64
12+
ENV DSE_HOME=/opt/dse
13+
RUN set -x \
14+
&& rm ${DSE_HOME}/resources/cassandra/lib/netty*linux-x86*
15+
16+
FROM --platform=$BUILDPLATFORM dse-server-base-${TARGETARCH} AS dse-server-base
717

818
#############################################################
919

0 commit comments

Comments
 (0)