This repository has been archived by the owner on Nov 29, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
101 lines (81 loc) · 3.9 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
FROM debian:jessie-backports
# Add DSE group and user
RUN groupadd -r dse --gid=999 \
&& useradd -m -d /home/dse -r -g dse --uid=999 dse
# gosu for easy step down from root
ENV GOSU_VERSION 1.7
RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true \
&& apt-get purge -y --auto-remove ca-certificates wget
# Install JRE and Python prereqs
RUN set -x \
&& apt-get update \
&& apt-get -t jessie-backports install -y openjdk-8-jre-headless \
ca-certificates-java \
python \
python-support \
curl \
&& rm -rf /var/lib/apt/lists/*
# Get the version of DSE we're installing from the build argument
ARG DSE_VERSION
ENV DSE_VERSION ${DSE_VERSION}
# The URL where the DSE download credentials .netrc file is located
ARG DSE_CREDENTIALS_URL
# Download DSE by grabbing the .netrc credentials from the DSE_CREDENTIALS_URL, then unpack to
# /opt, and create a link (regardless of DSE version) under /opt/dse, making sure to clean up
# the credentials and other downloaded files
RUN set -x \
&& export DSE_TEMP="$(mktemp -d)" \
&& cd "$DSE_TEMP" \
&& curl -SLO "$DSE_CREDENTIALS_URL/.netrc" \
&& curl --netrc-file .netrc -SLO "http://downloads.datastax.com/enterprise/dse-$DSE_VERSION-bin.tar.gz" \
&& curl --netrc-file .netrc -SLO "http://downloads.datastax.com/enterprise/dse-$DSE_VERSION-bin.tar.gz.md5" \
&& md5sum -c *.md5 \
&& tar -xzf "dse-$DSE_VERSION-bin.tar.gz" -C /opt \
&& cd / \
&& rm -rf "$DSE_TEMP" \
&& ln -s /opt/dse* /opt/dse \
&& chown -R dse:dse /opt/dse*
# Append DSE binaries directory to the PATH so we can execute them from any working directory
ENV PATH /opt/dse/bin:$PATH
# Create directories for Cassandra and Spark data
RUN mkdir -p /var/lib/cassandra /var/lib/spark /var/lib/spark/worker /var/lib/spark/rdd /var/lib/dsefs \
&& chown -R dse:dse /var/lib/cassandra /var/lib/spark /var/lib/dsefs \
&& chmod 777 /var/lib/cassandra /var/lib/spark /var/lib/dsefs
# Create log directories
RUN mkdir -p /var/log/cassandra /var/log/spark \
&& chown -R dse:dse /var/log/cassandra /var/log/spark \
&& chmod 777 /var/log/cassandra /var/log/spark
# Volumes for Cassandra and Spark data
VOLUME /var/lib/cassandra /var/lib/spark /var/lib/dsefs /var/log/cassandra /var/log/spark
# Volume for configuration files in resources
VOLUME /opt/dse/resources
# Entrypoint script for launching
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
# Cassandra ports (intra-node, TLS intra-node, JMX, CQL, Thrift, DSEFS intra-node, intra-node messaging service)
EXPOSE 7000 7001 7199 8609 9042 9160
# DSE Search (Solr)
EXPOSE 8983 8984
# DSE Analytics (Spark)
EXPOSE 4040 7077 7080 7081 8090 9999 18080
# BYOH (this is deprecated and will be removed at some point)
EXPOSE 8012 9290 10000 50030 50060
# DSE Graph
EXPOSE 8182
# DSEFS
EXPOSE 5598 5599
# Ports purposefully not exposed by default:
# 9091 for DS Studio because it's not part of this image
# 8888 for OpsCenter because it's not part of this image
# Run DSE in foreground by default
CMD [ "dse", "cassandra", "-f" ]