소스 검색

add dockerfile.dev

Zhang Li 2 년 전
부모
커밋
928a974a0a
2개의 변경된 파일94개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      Dockerfile.combined
  2. 91 0
      Dockerfile.dev

+ 3 - 2
Dockerfile.combined

@@ -11,8 +11,9 @@ RUN echo "deb http://mirror.nju.edu.cn/debian/ bullseye main contrib non-free" >
 COPY . /src/
 ENV PYTHONPATH=/src
 RUN cd /src && ./bdist_wheel.sh && \
-    cd ./sparkmagic && ./bdist_wheel.sh && \
-    cd ../dag && make yarn-install build-ui build-server
+    cd ./sparkmagic && ./bdist_wheel.sh
+# && \
+# cd ../dag && make yarn-install build-ui build-server
 
 FROM jupyterhub/jupyterhub:2.3
 COPY docker_jupyterhub/requirements.txt .

+ 91 - 0
Dockerfile.dev

@@ -0,0 +1,91 @@
+FROM node:16.15.1-bullseye-slim AS builder-fe
+COPY docker_build/requirements.txt .
+RUN echo "deb http://mirror.nju.edu.cn/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \
+    echo "deb http://mirror.nju.edu.cn/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \
+    echo "deb http://mirror.nju.edu.cn/debian/ bullseye-backports main contrib non-free" >> /etc/apt/sources.list && \
+    echo "deb http://mirror.nju.edu.cn/debian-security bullseye-security main contrib non-free" >> /etc/apt/sources.list && \
+    apt update && apt install -y python3 python3-pip python-is-python3 make \
+    && pip config set global.index-url https://mirror.nju.edu.cn/pypi/web/simple \
+    && pip install -U pip setuptools && pip install -r requirements.txt \
+    && yarn config set registry https://registry.npmmirror.com
+COPY . /src/
+ENV PYTHONPATH=/src
+RUN cd /src && chmod a+x  ./bdist_wheel.sh && ./bdist_wheel.sh
+
+FROM ubuntu:18.04 AS builder
+
+RUN sed -i 's#archive.ubuntu.com#mirrors.aliyun.com#g' /etc/apt/sources.list  \
+    && sed -i 's#security.ubuntu.com#mirrors.aliyun.com#g' /etc/apt/sources.list
+
+ENV LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh LC_ALL=zh_CN.UTF-8 DEBIAN_FRONTEND=noninteractive
+
+RUN rm -rf  /etc/apt/sources.list.d/  && apt update
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+    supervisor \
+    iputils-ping \
+    wget \
+    zsh \
+    build-essential \
+    cmake \
+    git \
+    curl \
+    vim \
+    ca-certificates \
+    libjpeg-dev \
+    zip \
+    unzip \
+    libpng-dev \
+    openssh-server \
+    autojump \
+    language-pack-zh-hans \
+    ttf-wqy-zenhei \
+    libgl1-mesa-glx  \
+    libglib2.0-0 \
+    locales &&\
+    rm -rf /var/lib/apt/lists/*
+
+
+RUN locale-gen zh_CN.UTF-8
+RUN dpkg-reconfigure locales
+
+
+CMD ["supervisord", "-n"]
+
+
+FROM builder as builder1
+
+ENV PYTHON_VERSION 3
+RUN chsh -s `which zsh`
+RUN curl -o ~/miniconda.sh -O  https://repo.anaconda.com/miniconda/Miniconda${PYTHON_VERSION}-latest-Linux-x86_64.sh  && \
+    chmod +x ~/miniconda.sh && \
+    ~/miniconda.sh -b -p /opt/conda && \
+    rm ~/miniconda.sh
+
+RUN ln /opt/conda/bin/conda /usr/local/bin/conda
+RUN conda init zsh
+RUN conda install mamba -n base -c conda-forge
+RUN ln /opt/conda/bin/mamba /usr/local/bin/mamba && mamba init zsh
+
+
+
+FROM builder1 as builder2
+WORKDIR /workspace
+
+COPY --from=builder-fe /src/dist  dist
+RUN /opt/conda/bin/pip install dist/*.whl
+RUN /opt/conda/bin/jupyter lab --generate-config && \
+    echo "c.NotebookApp.password='argon2:\$argon2id\$v=19\$m=10240,t=10,p=8\$+zIUCF9Uk2FiCHlV8njX5A\$I5Mm/64DORArcXYTXWRVng'">>/root/.jupyter/jupyter_lab_config.py
+
+RUN mkdir -p /workspace && echo "\
+[program:jupyter]\n\
+directory=/workspace\n\
+command=/opt/conda/bin/jupyter lab --ip 0.0.0.0 --port 8888 --allow-root --no-browser \n\
+autorestart=true\n\
+startretries=0\n\
+redirect_stderr=true\n\
+stdout_logfile=/var/log/jupyter.log\n\
+stdout_logfile_maxbytes=50MB\n\
+" > /etc/supervisor/conf.d/jupyter.conf
+
+EXPOSE 8888