-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docker): Use ubuntu and eclipse-temurin base image
Problem described in #13, missing libsnappy and linker loader errors requires us to change from alpine base to ubuntu base (default base image for `eclipse-temurin`). Some environmental variables for Linker loader have been added to point to the libraries installed by the package manager. Signed-off-by: Dusan Malusev <[email protected]>
- Loading branch information
1 parent
827b728
commit fea4373
Showing
1 changed file
with
32 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,55 @@ | ||
FROM amazoncorretto:11-alpine AS build | ||
FROM eclipse-temurin:11-jdk-noble AS build | ||
|
||
ARG CASSANDRA_STRESS_VERSION | ||
|
||
ENV LD_LIBRARY_PATH="/lib/x86_64-linux-gnu:/usr/local/lib:/usr/lib:/lib:/lib64:/usr/local/lib/x86_64-linux-gnu" | ||
ENV DEBIAN_FRONTEND="noninteractive" | ||
ENV TZ="UTC" | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add apache-ant bash \ | ||
RUN ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime \ | ||
&& echo "$TZ" > /etc/timezone \ | ||
&& apt update \ | ||
&& apt install -y ant \ | ||
&& ant realclean \ | ||
&& mkdir -p build lib \ | ||
&& ant -Drelease=true -Dversion="$CASSANDRA_STRESS_VERSION" artifacts \ | ||
&& bash ./SCYLLA-VERSION-GEN \ | ||
&& cp build/SCYLLA-* build/dist/ | ||
|
||
FROM amazoncorretto:11-alpine AS production | ||
FROM eclipse-temurin:11-jre-noble AS production | ||
|
||
ENV SCYLLA_HOME=/scylla-tools-java | ||
ENV SCYLLA_CONF=/scylla-tools-java/conf | ||
ENV PATH=$PATH:$SCYLLA_HOME/tools/bin | ||
ENV LD_LIBRARY_PATH="/lib/x86_64-linux-gnu:/usr/local/lib:/usr/lib:/lib:/lib64:/usr/local/lib/x86_64-linux-gnu" | ||
ENV DEBIAN_FRONTEND="noninteractive" | ||
ENV TZ="UTC" | ||
|
||
WORKDIR $SCYLLA_HOME | ||
|
||
ENV PATH=$PATH:$SCYLLA_HOME/tools/bin | ||
|
||
COPY --from=build /app/build/dist . | ||
|
||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add bash \ | ||
RUN ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime \ | ||
&& echo "$TZ" > /etc/timezone \ | ||
&& apt update \ | ||
&& apt upgrade -y \ | ||
&& apt install -y libsnappy-java libsnappy-jni \ | ||
&& chmod +x tools/bin/cassandra-stress \ | ||
&& chmod +x tools/bin/cassandra-stressd \ | ||
&& rm tools/bin/*.bat | ||
|
||
SHELL [ "/bin/bash" ] | ||
|
||
CMD ["cassandra-stress"] | ||
&& rm tools/bin/*.bat \ | ||
&& apt-get purge -y \ | ||
gcc make g++ apt-transport-https \ | ||
autoconf bzip2 cpp libasan8 m4 libtirpc3 libtsan2 libubsan1 build-essential \ | ||
pkg-config pkgconf pkgconf-bin build-essential \ | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
ENTRYPOINT [ "/bin/bash", "-o", "pipefail", "-c" ] | ||
|
||
CMD ["cassandra-stress"] |