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