-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.tmpl
49 lines (38 loc) · 1.51 KB
/
Dockerfile.tmpl
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
FROM phusion/baseimage:0.9.17
MAINTAINER pitrho
ENV DEBIAN_FRONTEND noninteractive
# Install Oracle Java 8
RUN apt-add-repository ppa:webupd8team/java \
&& apt-get update \
&& echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections \
&& apt-get install -y oracle-java8-installer dnsutils python python-support libjemalloc1
# Install cassandra
ENV CASSANDRA_VERSION %%CASSANDRA_VERSION%%
RUN curl -L -O http://dl.bintray.com/apache/cassandra/pool/main/c/cassandra/cassandra_%%CASSANDRA_VERSION%%_all.deb \
&& dpkg -i cassandra_%%CASSANDRA_VERSION%%_all.deb \
&& update-rc.d -f cassandra remove \
&& rm cassandra_%%CASSANDRA_VERSION%%_all.deb
RUN curl -L -O http://dl.bintray.com/apache/cassandra/pool/main/c/cassandra/cassandra-tools_%%CASSANDRA_VERSION%%_all.deb \
&& dpkg -i cassandra-tools_%%CASSANDRA_VERSION%%_all.deb \
&& update-rc.d -f cassandra remove \
&& rm cassandra-tools_%%CASSANDRA_VERSION%%_all.deb
ENV CASSANDRA_CONFIG /etc/cassandra
# listen to all rpc
RUN sed -ri ' \
s/^(rpc_address:).*/\1 0.0.0.0/; \
' "$CASSANDRA_CONFIG/cassandra.yaml"
# 7000: intra-node communication
# 7001: TLS intra-node communication
# 7199: JMX
# 9042: CQL
# 9160: thrift service
EXPOSE 7000 7001 7199 9042 9160
# Add all services files
RUN mkdir /etc/service/cassandra
COPY run.sh /etc/service/cassandra/run
# Remove the CRON service
RUN rm -rf /etc/service/cron
# Add cqlshrc file
RUN mkdir /root/.cassandra
COPY cqlshrc /root/.cassandra/cqlshrc
CMD ["/sbin/my_init"]