@@ -4,11 +4,13 @@ FROM $FROM_IMAGES
44
55ARG PYTHONVERSION
66ARG CONDAENV
7+ ARG CUDAVERSION=cu118
8+ ARG TARGETARCH=amd64
79
8- RUN apt update
910ENV TZ Asia/Shanghai
1011ENV DEBIAN_FRONTEND noninteractive
1112
13+ RUN apt update -y
1214# 安装运维工具
1315RUN apt install -y -f --no-install-recommends vim apt-transport-https gnupg2 ca-certificates-java rsync jq wget git dnsutils iputils-ping net-tools curl mysql-client locales zip unzip nginx lsof
1416
@@ -24,10 +26,18 @@ RUN echo "alias ll='ls -alF'" >> /root/.bashrc && \
2426 echo "alias vi='vim'" >> /root/.bashrc && \
2527 /bin/bash -c "source /root/.bashrc"
2628
27- # 安装anaconda
28- RUN wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
29- mkdir /root/.conda && bash Miniconda3-latest-Linux-x86_64.sh -b && \
30- rm -f Miniconda3-latest-Linux-x86_64.sh
29+ # 安装amd64的conda
30+ RUN if [ "$TARGETARCH" = "amd64" ]; then \
31+ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh; \
32+ mkdir /root/.conda && bash Miniconda3-latest-Linux-x86_64.sh -b ; \
33+ rm -f Miniconda3-latest-Linux-x86_64.sh ; \
34+ fi
35+ # 安装arm64的conda
36+ RUN if [ "$TARGETARCH" = "arm64" ]; then \
37+ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-aarch64.sh ; \
38+ mkdir /root/.conda && bash Miniconda3-latest-Linux-aarch64.sh -b ; \
39+ rm -f Miniconda3-latest-Linux-aarch64.sh ; \
40+ fi
3141
3242# 激活python3
3343ENV PATH "/root/miniconda3/bin":$PATH
@@ -45,10 +55,11 @@ RUN apt install -y openssh-server openssh-client
4555
4656# 安装
4757RUN apt install -y -f python3-opencv ffmpeg
58+ COPY pip.conf /root/.pip/pip.conf
4859RUN pip3 install celery redis pyarrow requests_toolbelt cryptography tqdm fsspec aiohttp librosa flask werkzeug requests tornado Pillow pysnooper opencv-python numpy scipy matplotlib scikit-image ipython pyyaml visualdl filelock && rm -rf ~/.cache
4960
50- RUN pip install --upgrade pip && pip install tornado==6.2 gsutil simplejson sqlalchemy joblib scikit-learn jinja2 requests numpy pandas flask pymysql pysnooper pyyaml jupyterlab==3.4.8 voila notebook==6.4.12 && rm -rf /tmp/* /var/tmp/* /root/.cache \
51-
61+ RUN pip install --upgrade pip && pip install tornado==6.2 gsutil simplejson sqlalchemy joblib scikit-learn jinja2 requests numpy pandas flask pymysql pysnooper pyyaml jupyterlab==3.4.8 voila notebook==6.4.12 && rm -rf /tmp/* /var/tmp/* /root/.cache
62+ RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${CUDAVERSION} && rm -rf /tmp/* /var/tmp/* /root/.cache
5263#RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager
5364#RUN pip install --upgrade jupyterlab-git jupyterlab_tensorboard_pro && jupyter lab build && jupyter labextension install jupyterlab_tensorboard_pro && jupyter serverextension enable jupyterlab_tensorboard_pro --sys-prefix
5465
0 commit comments