在网上下载一个anaconda3的安装包,将其改名为anaconda.sh放入Dockfile文件夹
FROM yutianchi/cuda:11.2.1-cudnn8-runtime-ubuntu18.04
USER root
# 安装必要的工具和依赖项
RUN apt-get update && apt-get install -y \
build-essential \
curl \
wget \
git \
libsm6 \
libxext6 \
libxrender-dev \
bzip2 \
ca-certificates \
libglib2.0-0 \
libgl1-mesa-glx \
libxrender1 \
libxext-dev \
libglu1-mesa \
libxi-dev \
libxmu-dev \
libglu1-mesa-dev \
libgl1-mesa-dev \
libsm-dev \
libx11-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY anaconda.sh /root/
# RUN curl -s -o ~/anaconda.sh -O https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh && \
RUN chmod +x ~/anaconda.sh && \
~/anaconda.sh -b -p /opt/conda && \
rm ~/anaconda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
# echo "conda activate base" >> ~/.bashrc && \
/opt/conda/bin/conda update -n base -c defaults conda && \
/opt/conda/bin/conda clean -ya
# 设置环境变量
ENV PATH /opt/conda/bin:$PATH
# 设置工作目录
WORKDIR /app
#sudo docker build -t yutianchi/11.2.1-cudnn8-runtime-ubuntu18.04-conda:1.0.0 .
#sudo docker run --rm -it yutianchi/11.2.1-cudnn8-runtime-ubuntu18.04-conda:1.0.0
版权声明:本文为weixin_39289876原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。