-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
57 lines (41 loc) · 1.86 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM eclipse-temurin:11-jdk-noble AS build
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
RUN --mount=type=cache,target=/var/cache/apt ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime \
&& echo "$TZ" > /etc/timezone \
&& apt update \
&& apt install -y ant
COPY . .
ARG CASSANDRA_STRESS_VERSION=666.development
ARG BUILD_OPTS
RUN --mount=type=cache,target=/root/.m2 ant realclean \
&& ant ${BUILD_OPTS} \
&& ant ${BUILD_OPTS} -Drelease=true -Dversion="${CASSANDRA_STRESS_VERSION}" artifacts \
&& chmod +x build/dist/bin/cassandra-stress
FROM eclipse-temurin:11-jre-noble AS production
LABEL org.opencontainers.image.source="https://github.com/scylladb/cassandra-stress"
LABEL org.opencontainers.image.title="ScyllaDB Cassandra Stress"
ENV CASSANDRA_STRESS_HOME="/usr/local/share/cassandra-stress"
ENV PATH="$PATH:$CASSANDRA_STRESS_HOME/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 $CASSANDRA_STRESS_HOME
COPY --from=build /app/build/dist .
RUN --mount=type=cache,target=/var/cache/apt ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime \
&& echo "$TZ" > /etc/timezone \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y libsnappy-java libsnappy-jni \
&& 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"]