123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- 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
- 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
- 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
- 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
- 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
- COPY app.py /app/app.py
- COPY tool.py /app/tool.py
- COPY cifar-10-batches-py.tar.gz /root/.keras/datasets/cifar-10-batches-py.tar.gz
- COPY mnist.npz /root/.keras/datasets/mnist.npz
- RUN echo "conda activate lemon" >> ~/.bashrc
- ENV TZ=Asia/Shanghai
- RUN echo "${TZ}" > /etc/timezone \
- && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
- && apt update \
- && apt install -y tzdata \
- && rm -rf /var/lib/apt/lists/*
- WORKDIR /app
- ENTRYPOINT ["/bin/bash", "-c", "source ~/.bashrc && /opt/conda/envs/lemon/bin/python app.py"]
|