Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docker): Use ubuntu and eclipse-temurin base image #14

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 32 additions & 15 deletions Dockerfile
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"]