diff --git a/Dockerfile b/Dockerfile index 38abc47db2..76e8c6de6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file + && 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"]