Dockerfile 1.4 KB

12345678910111213141516171819202122
  1. FROM jupyterhub/jupyterhub:2.3
  2. COPY requirements.txt .
  3. RUN echo "deb http://mirror.nju.edu.cn/ubuntu/ focal main restricted universe multiverse" > /etc/apt/sources.list && \
  4. echo "deb http://mirror.nju.edu.cn/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list && \
  5. echo "deb http://mirror.nju.edu.cn/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
  6. echo "deb http://mirror.nju.edu.cn/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list && \
  7. apt update && apt install -y libkrb5-dev krb5-user gcc python3-dev git openjdk-8-jre && \
  8. pip config set global.index-url https://mirror.nju.edu.cn/pypi/web/simple && \
  9. pip install -r requirements.txt && rm requirements.txt && \
  10. jupyter kernelspec install /usr/local/lib/python3.8/dist-packages/sparkmagic/kernels/pysparkkernel && \
  11. 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 && \
  12. mkdir -p /opt/cluster/conf && \
  13. tar -xf hadoop-3.2.3.tar.gz -C /opt/cluster/
  14. COPY config.json /etc/sparkmagic/
  15. COPY config.py /etc/jupyterhub/
  16. COPY jupyter_lab_config.py /etc/jupyter/
  17. ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
  18. ENV HADOOP_HOME=/opt/cluster/hadoop-3.2.3
  19. ENV HADOOP_CONF_DIR=/opt/cluster/conf
  20. ENV LD_LIBRARY_PATH=/opt/cluster/hadoop/lib/native
  21. COPY run.py .
  22. CMD ["python3", "run.py"]