Dockerfile 907 B

123456789101112131415161718192021222324
  1. FROM ylproj-livy-build:1.0.0 AS builder
  2. COPY . /src/
  3. RUN if [ -e /src/.cache/maven_pkg_cache.tar.gz ]; then \
  4. rm -rf /root/.m2/repository && \
  5. tar -xf /src/.cache/maven_pkg_cache.tar.gz -C /root/.m2/ \
  6. ;fi && \
  7. if [ -e /src/.cache/spark-3.0.3-bin-hadoop3.2.tgz ]; then \
  8. mv /src/.cache/spark-3.0.3-bin-hadoop3.2.tgz /src/ \
  9. ;else \
  10. curl -fL http://mirror.nju.edu.cn/apache/spark/spark-3.0.3/spark-3.0.3-bin-hadoop3.2.tgz -o /src/spark-3.0.3-bin-hadoop3.2.tgz \
  11. ;fi && \
  12. cd /src && ./build.sh
  13. FROM ylproj-livy-base:1.0.0
  14. WORKDIR /opt/cluster
  15. COPY --from=builder /src/assembly/target/apache-livy-*-bin.zip .
  16. RUN unzip apache-livy-*-bin.zip && \
  17. mv apache-livy-*-bin livy && \
  18. mkdir livy/logs && \
  19. rm -rf apache-livy-*-bin.zip
  20. ENV LIVY_HOME=/opt/cluster/livy
  21. ENV LIVY_CONF_DIR=/opt/cluster/conf
  22. WORKDIR /opt/cluster/livy
  23. CMD ["bin/livy-server"]