Skip to content

Commit

Permalink
Merge pull request #14 from CodeLieutenant/fix/libsnappy-missing
Browse files Browse the repository at this point in the history
fix(docker): Use ubuntu and eclipse-temurin base image
  • Loading branch information
CodeLieutenant authored Aug 21, 2024
2 parents 9d0609e + fea4373 commit dcf5ba1
Showing 1 changed file with 32 additions and 15 deletions.
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"]

0 comments on commit dcf5ba1

Please sign in to comment.