-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
106 lines (82 loc) · 3.47 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
102
103
104
105
106
# Provided without any warranty, these files are intended
# to accompany the whitepaper about DSE on Docker and are
# not intended for production and are not actively maintained.
# Loosely based on docker-cassandra by the fine folk at Spotify
# -- https://github.com/spotify/docker-cassandra/
# Loosely based on cassandra-docker by the one and only Al Tobey
# -- https://github.com/tobert/cassandra-docker/
# base yourself on any ubuntu 14.04 image containing JDK8
# official Docker Java images are distributed with OpenJDK
# Datastax certifies its product releases specifically
# on the Oracle/Sun JVM, so YMMV with OpenJDK
FROM nimmis/java:oracle-8-jdk
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get -y install adduser \
curl \
lsb-base \
procps \
zlib1g \
gzip \
python \
sysstat \
iputils-ping \
ntp bash tree && \
wget http://launchpadlibrarian.net/109052632/python-support_1.0.15_all.deb && \
dpkg -i python-support_1.0.15_all.deb && \
rm -rf /var/lib/apt/lists/*
# grab gosu for easy step-down from root
RUN curl -o /bin/gosu -SkL "https://github.com/tianon/gosu/releases/download/1.4/gosu-$(dpkg --print-architecture)" \
&& chmod +x /bin/gosu
# DSE tarball can be download into the folder where Dockerfile is
# wget --user=$USER --password=$PASS http://downloads.datastax.com/enterprise/dse-5.0.0-bin.tar.gz
# you may want to replace dse-5.0.0-bin.tar.gz with the corresponding downloaded package name. When
# downloaded, please remove the version number part of the filename (or create a symlink), so the
# resulting file is named dse-bin.tar.gz (that way the docker file itself remains version independent).
#
# DataStax Agent debian package can be downloaded from
# wget --user=$USER --password=$PASS http://debian.datastax.com/enterprise/pool/datastax-agent_6.0.0_all.deb
# you may want to replace the specific version with the corresponding downloaded package name. When
# downloaded, please remove the version number part of the filename (or create a symlink), so the
# resulting file is named datastax-agent_all.deb (that way the docker file itself remains version
# independent).
ADD dse-bin.tar.gz /opt
# ADD datastax-agent_all.deb /tmp
ENV DSE_HOME /opt/dse
RUN ln -s /opt/dse* $DSE_HOME
# keep data here
VOLUME /data
# and logs here
VOLUME /logs
VOLUME /opt/dse
# create a dedicated user for running DSE node
RUN groupadd -g 1337 cassandra && \
useradd -u 1337 -g cassandra -s /bin/bash -d $DSE_HOME cassandra && \
chown -R cassandra:cassandra /opt/dse*
# install the agent
# RUN dpkg -i /tmp/datastax-agent_all.deb
# starting node using custom entrypoint that configures paths, interfaces, etc.
COPY scripts/dse-entrypoint /usr/local/bin/
RUN chmod +x /usr/local/bin/dse-entrypoint
ENTRYPOINT ["/usr/local/bin/dse-entrypoint"]
# Running any other DSE/C* command should be done on behalf dse user
# Perform that using a generic command laucher
COPY scripts/dse-cmd-launcher /usr/local/bin/
RUN chmod +x /usr/local/bin/dse-cmd-launcher
# link dse commands to the launcher
RUN for cmd in cqlsh dsetool nodetool dse cassandra-stress; do \
ln -sf /usr/local/bin/dse-cmd-launcher /usr/local/bin/$cmd ; \
done
# the detailed list of ports
# http://docs.datastax.com/en/datastax_enterprise/5.0/datastax_enterprise/sec/secConfFirePort.html
# Cassandra
EXPOSE 7000 9042 9160
# Solr
EXPOSE 8983 8984
# Spark
EXPOSE 4040 7080 7081 7077
# Hadoop
EXPOSE 8012 50030 50060 9290
# Hive/Shark
EXPOSE 10000
# Graph