-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDockerfile
38 lines (30 loc) · 1.34 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
FROM debian:stretch-slim
ARG APACHE_SPARK_VERSION=2.2.0
ARG HADOOP_VERSION=2.7
ARG DUMP_INIT_VERSION=1.2.1
ENV SPARK_NAME=spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}
ENV DUMP_INIT_DEB_NAME=dumb-init_${DUMP_INIT_VERSION}_amd64.deb
ENV SPARK_DIR /opt/${SPARK_NAME}
ENV SPARK_HOME /usr/local/spark
WORKDIR /gemini
COPY ./src/main/python/community-detector/requirements.txt /gemini/src/main/python/community-detector/requirements.txt
RUN mkdir -p /usr/share/man/man1 && \
apt-get update && \
apt-get install -y --no-install-recommends \
openjdk-8-jre-headless openjdk-8-jdk ca-certificates-java curl \
python3 python3-pip python3-igraph && \
pip3 install setuptools wheel && \
pip3 install --only-binary=numpy,scipy -r src/main/python/community-detector/requirements.txt && \
rm -rf /var/lib/apt/* && \
curl http://d3kbcqa49mib13.cloudfront.net/${SPARK_NAME}.tgz | \
tar xzf - -C /opt && \
curl -L -o ${DUMP_INIT_DEB_NAME} \
https://github.com/Yelp/dumb-init/releases/download/v${DUMP_INIT_VERSION}/${DUMP_INIT_DEB_NAME} && \
dpkg -i dumb-init_*.deb && \
rm ${DUMP_INIT_DEB_NAME} && \
apt-get clean
RUN ln -s $SPARK_DIR $SPARK_HOME
COPY . /gemini
RUN ./sbt assemblyPackageDependency && ./sbt assembly && ./sbt package
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["bash", "-c", "sleep infinity & wait"]