# 创建一个基础镜像 FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04 RUN apt-key del 7fa2af80 RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub # 重置apt-get RUN rm -rf /etc/apt/sources.list RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list RUN apt-get update RUN apt-get install -y default-jre RUN apt-get install -y cmake # 安装conda # yhyu13 : install additional packages # 设置apt的源为tsinghua镜像源 RUN sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list RUN apt-get update && apt-get install -y curl wget # 安装conda RUN curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \ && bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda \ && rm Miniconda3-latest-Linux-x86_64.sh RUN /opt/conda/bin/conda init bash RUN mkdir env # 解压env中的mxnet tensorflow lemon COPY env/mxnet.tar.gz env/mxnet.tar.gz RUN mkdir /opt/conda/envs/mxnet RUN tar -zxvf env/mxnet.tar.gz -C /opt/conda/envs/mxnet COPY env/tensorflow.tar.gz env/tensorflow.tar.gz RUN mkdir /opt/conda/envs/tensorflow RUN tar -zxvf env/tensorflow.tar.gz -C /opt/conda/envs/tensorflow COPY env/lemon.tar.gz env/lemon.tar.gz RUN mkdir /opt/conda/envs/lemon RUN tar -zxvf env/lemon.tar.gz -C /opt/conda/envs/lemon RUN rm -rf env # 复制项目文件 WORKDIR /app COPY LEMON-master /app/LEMON-master RUN echo "conda activate lemon" >> ~/.bashrc # RUN conda install -n lemon cudatoolkit=10.1 # 随便启动一个进程空转 CMD ["/bin/bash"] # CMD ["tail", "-f", "/dev/null"]