forked from mia-li-z/ldbc_snb_datagen_spark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (31 loc) · 1.01 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
FROM eclipse-temurin:8 as build-jar
RUN apt-get update
RUN apt-get install -y curl
ARG SBT_VERSION=1.5.2
RUN cd /opt && curl -fSsL https://github.com/sbt/sbt/releases/download/v${SBT_VERSION}/sbt-${SBT_VERSION}.tgz | tar xvz
ENV PATH=/opt/sbt/bin:$PATH
WORKDIR build
COPY build.sbt build.sbt
COPY project project
RUN sbt update
COPY src src
RUN sbt assembly
FROM scratch as jar
COPY --from=build-jar /build/target/ldbc_snb_datagen_*-jar-with-dependencies.jar /jar
FROM python:3.7-slim as build-tools
RUN pip install --no-cache virtualenv && virtualenv -p python3.7 /tools
COPY tools build
WORKDIR build
RUN . /tools/bin/activate && pip install .
FROM python:3.7-slim as tools
COPY --from=build-tools /tools /tools
FROM bde2020/spark-master:3.2.1-hadoop3.2 as standalone
COPY --from=jar /jar /jar
COPY --from=tools /tools /tools
RUN ln -sf /usr/bin/python3 /tools/bin/python
ENV TEMP_DIR /tmp
ENV SPARK_LOCAL_DIRS ${TEMP_DIR}
ENV PATH=/tools/bin:/spark/bin:$PATH
ENV LDBC_SNB_DATAGEN_JAR=/jar
WORKDIR /
ENTRYPOINT ["run.py"]