Dockerfile 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. FROM node:16.15.1-bullseye-slim AS builder
  2. WORKDIR /src
  3. COPY . /src/
  4. ENV PYTHONPATH=/src
  5. RUN echo "deb http://mirror.nju.edu.cn/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \
  6. echo "deb http://mirror.nju.edu.cn/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \
  7. echo "deb http://mirror.nju.edu.cn/debian/ bullseye-backports main contrib non-free" >> /etc/apt/sources.list && \
  8. echo "deb http://mirror.nju.edu.cn/debian-security bullseye-security main contrib non-free" >> /etc/apt/sources.list && \
  9. apt update && apt install -y python3 python3-pip python-is-python3 make git \
  10. && pip config set global.index-url https://mirror.nju.edu.cn/pypi/web/simple \
  11. && pip install -U pip setuptools && pip install -r /src/docker_build/requirements.txt \
  12. && yarn config set registry https://registry.npmmirror.com \
  13. && rm -rf sparkmagic && git clone -b yili http://gogsb.soaringnova.com/ylproj/sparkmagic.git \
  14. && ./bdist_wheel.sh && cd sparkmagic && ./bdist_wheel.sh
  15. FROM jupyterhub/jupyterhub:2.3
  16. COPY --from=builder /src/dist/*.whl /src/sparkmagic/dist/*.whl /dist/
  17. COPY docker_jupyterhub/requirements.txt .
  18. RUN echo "deb http://mirror.nju.edu.cn/ubuntu/ focal main restricted universe multiverse" > /etc/apt/sources.list && \
  19. echo "deb http://mirror.nju.edu.cn/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list && \
  20. echo "deb http://mirror.nju.edu.cn/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
  21. echo "deb http://mirror.nju.edu.cn/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list && \
  22. apt update && apt install -y libkrb5-dev krb5-user gcc python3-dev git openjdk-8-jre && \
  23. pip config set global.index-url https://mirror.nju.edu.cn/pypi/web/simple && \
  24. pip install -r requirements.txt && rm requirements.txt && pip install /dist/*.whl && rm -rf /dist && \
  25. jupyter kernelspec install /usr/local/lib/python3.8/dist-packages/sparkmagic/kernels/pysparkkernel && \
  26. curl -fL http://mirror.nju.edu.cn/apache/hadoop/common/hadoop-3.2.3/hadoop-3.2.3.tar.gz -o hadoop-3.2.3.tar.gz && \
  27. mkdir -p /opt/cluster/conf && tar -xf hadoop-3.2.3.tar.gz -C /opt/cluster/ && rm hadoop-3.2.3.tar.gz && \
  28. useradd -m -p "VawT4F4qizTuw" test1 && \
  29. useradd -m -p "vt8SVDBWk0fHI" test2 && \
  30. useradd -m -p "c8dthZ3HAoxYY" test3
  31. COPY docker_jupyterhub/config.json /etc/sparkmagic/
  32. COPY docker_jupyterhub/config.py /etc/jupyterhub/
  33. COPY docker_jupyterhub/jupyter_lab_config.py /etc/jupyter/
  34. ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
  35. ENV HADOOP_HOME=/opt/cluster/hadoop-3.2.3
  36. ENV HADOOP_CONF_DIR=/opt/cluster/conf
  37. ENV LD_LIBRARY_PATH=/opt/cluster/hadoop/lib/native
  38. COPY docker_jupyterhub/run.py .
  39. COPY docker/cluster /opt/cluster
  40. COPY docker/krb5.conf /etc
  41. CMD ["python3", "run.py"]