Skip to content

Commit d1d6228

Browse files
committed
Attempt to replace Netty jars with ARM compatible ones
1 parent f442a22 commit d1d6228

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

dse/Dockerfile-dse6.9.jdk11

+28-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,31 @@
33
#
44
ARG DSE_VERSION=6.9.7
55
ARG DS_BASE_DEBIAN=ds-base-ubuntu-openjdk-11
6-
ARG BASETAG=11.0.22-jdk-ubuntu-20240427
6+
ARG BASETAG=11.0.26-4-1ubuntu1-20.04
7+
FROM --platform=$BUILDPLATFORM maven:3.8.6-openjdk-11-slim AS netty-setup-base
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-kqueue:4.1.100.2.dse \
13+
## The artifacts below don't seem to be present yet, we'll need them for ARM images to work on OSX
14+
# && mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-kqueue:4.1.100.2.dse:jar:osx-x86_64 \
15+
# && mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-kqueue:4.1.100.2.dse:jar:osx-aarch_64 \
16+
&& mkdir /netty \
17+
&& find ~/.m2/repository/io/netty -type f -name "netty*4.1.100.2.dse*.jar" -exec cp {} /netty/ \;
18+
19+
FROM --platform=linux/arm64 netty-setup-base as netty-setup-arm64
20+
RUN set -x \
21+
&& mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-epoll:4.1.100.2.dse:jar:linux-aarch_64 \
22+
&& find ~/.m2/repository/io/netty -type f -name "netty*4.1.100.2.dse*.jar" -exec cp {} /netty/ \;
23+
24+
FROM --platform=linux/amd64 netty-setup-base as netty-setup-amd64
25+
RUN set -x \
26+
&& mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-epoll:4.1.100.2.dse:jar:linux-x86_64 \
27+
&& find ~/.m2/repository/io/netty -type f -name "netty*4.1.100.2.dse*.jar" -exec cp {} /netty/ \;
28+
29+
FROM netty-setup-${TARGETARCH} as netty-setup
30+
731
FROM datastax/${DS_BASE_DEBIAN}:${BASETAG} AS dse-server-prep
832

933
# Set up configuration variables
@@ -26,6 +50,8 @@ RUN set -x \
2650
&& mkdir -p "$DSE_HOME" \
2751
&& tar -C "$DSE_HOME" --strip-components=1 -xzf /${TARBALL} \
2852
&& rm /${TARBALL} \
53+
# Replace Netty with ARM compatible version
54+
&& find ${DSE_HOME}/resources/cassandra/lib/ -type f -name "netty*" -exec rm {} \; \
2955
# Unpack Agent tarball
3056
&& mkdir -p "$DSE_AGENT_HOME" \
3157
&& tar -C "$DSE_AGENT_HOME" --strip-components=1 -xzf /${DSE_AGENT_TARBALL} \
@@ -35,6 +61,7 @@ RUN set -x \
3561
&& apt-get install -y --install-recommends rdfind \
3662
&& rdfind -makehardlinks true -makeresultsfile false ${DSE_HOME} \
3763
&& chmod -R g+w ${DSE_HOME} ${DSE_AGENT_HOME}
64+
COPY --chown=dse:root --from=netty-setup /netty ${DSE_HOME}/resources/cassandra/lib/
3865
COPY dse/patches/remove-writable.patch /tmp
3966
RUN patch ${DSE_HOME}/bin/dse < /tmp/remove-writable.patch
4067

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)