forked from k8ssandra/management-api-for-apache-cassandra
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-dse-68
65 lines (50 loc) · 2.39 KB
/
Dockerfile-dse-68
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
58
59
60
61
62
63
64
65
ARG CASSANDRA_VERSION=6.8.9
FROM maven:3.6.3-jdk-8-slim as builder
ARG METRICS_COLLECTOR_VERSION=0.2.0
WORKDIR /build
COPY pom.xml ./
COPY management-api-agent-common/pom.xml ./management-api-agent-common/pom.xml
COPY management-api-agent-3.x/pom.xml ./management-api-agent-3.x/pom.xml
COPY management-api-agent-4.x/pom.xml ./management-api-agent-4.x/pom.xml
COPY management-api-agent-dse-6.8/pom.xml ./management-api-agent-dse-6.8/pom.xml
COPY management-api-common/pom.xml ./management-api-common/pom.xml
COPY management-api-server/pom.xml ./management-api-server/pom.xml
COPY settings.xml settings.xml /root/.m2/
# this duplicates work done in the next steps, but this should provide
# a solid cache layer that only gets reset on pom.xml changes
RUN mvn -q -ff -T 1C install -Pdse && rm -rf target
COPY management-api-agent-common ./management-api-agent-common
COPY management-api-agent-3.x ./management-api-agent-3.x
COPY management-api-agent-4.x ./management-api-agent-4.x
COPY management-api-agent-dse-6.8 ./management-api-agent-dse-6.8
COPY management-api-common ./management-api-common
COPY management-api-server ./management-api-server
RUN mvn -q -ff package -DskipTests -Pdse
FROM datastax/dse-server:${CASSANDRA_VERSION}
# accept the License
ENV DS_LICENSE=accept
ENV CASSANDRA_PATH /opt/dse
ENV MAAC_PATH /opt/management-api
ENV CASSANDRA_HOME ${CASSANDRA_PATH}
ENV CASSANDRA_CONF ${CASSANDRA_PATH}/resources/cassandra/conf
ENV CASSANDRA_LOGS ${CASSANDRA_PATH}/logs
# Log directory for Management API startup logs to avoid issues:
# https://datastax.jira.com/browse/DB-4627
# https://issues.apache.org/jira/browse/CASSANDRA-16027
ENV MGMT_API_LOG_DIR /var/log/cassandra
COPY --from=builder /build/management-api-agent-dse-6.8/target/datastax-mgmtapi-agent-dse-6.8-0.1.0-SNAPSHOT.jar ${MAAC_PATH}/datastax-mgmtapi-agent-0.1.0-SNAPSHOT.jar
COPY --from=builder /build/management-api-server/target/datastax-mgmtapi-server-0.1.0-SNAPSHOT.jar ${MAAC_PATH}/
USER root
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends wget iproute2; \
rm -rf /var/lib/apt/lists/*
# backwards compat with upstream ENTRYPOINT
COPY scripts/dse-6.8-docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
ln -sf /usr/local/bin/docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 9103
EXPOSE 8080
USER dse
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mgmtapi"]