栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

dockerfile 常用的环境编写 miniconda3 dockerfile python

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

dockerfile 常用的环境编写 miniconda3 dockerfile python

cpu

miniconda3的一个基础镜像,其中安装fastapi和opencv。

kevinchina/deeplearning:miniconda3base0.2

FROM kevinchina/deeplearning:wrfbaseenv
COPY deps /deps
RUN rm -rf /etc/yum.repos.d/* && 
    cp /deps/CentOS-base.repo /etc/yum.repos.d/ && 
    yum clean all
RUN yum install wget opencv -y
RUN wget http://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/conda.sh && 
    /bin/bash /tmp/conda.sh -b && 
    cp -f /deps/.condarc ~/ && rm /tmp/conda.sh
ENV PATH ~/miniconda3/bin:$PATH
RUN ~/miniconda3/bin/conda init bash && 
    . ~/.bashrc && 
    conda create -n py38 python=3.8.12 -y
RUN . ~/.bashrc && 
    conda activate py38 && 
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U && 
    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && 
    pip install fastapi uvicorn python-multipart requests opencv-python numpy
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone

在上一个基础上,安装pytorch cpu版本 1.8
kevinchina/deeplearning:miniconda3base0.3

FROM kevinchina/deeplearning:miniconda3base0.2
RUN . ~/.bashrc && conda activate py38 && conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cpuonly -c pytorch

GPU CUDA11.1

cuda11.1+pytorch1.8+opencv
kevinchina/deeplearning:cuda11.1pytorch1.8baseenv0.1

FROM kevinchina/deeplearning:cuda11.1pytorch1.8baseenv
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
GPU CUDA10.2

cuda10.2+pytorch1.8+opencv
kevinchina/deeplearning:cuda10.2pytorch1.8baseenv0.1

FROM nvidia/cuda:10.2-cudnn7-devel-centos7
COPY deps /deps
RUN rm -rf /etc/yum.repos.d/* && cp /deps/CentOS-base.repo /etc/yum.repos.d/ && yum clean all
RUN yum install wget opencv vim -y
RUN wget http://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/conda.sh && 
    bash /tmp/conda.sh -b && rm /tmp/conda.sh && 
    cp -f /deps/.condarc /root/
RUN ~/miniconda3/bin/conda init bash && . ~/.bashrc && conda create -n py38 python=3.8.12 -y
RUN . ~/.bashrc && conda activate py38 && pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U && pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && pip install fastapi uvicorn python-multipart requests opencv-python numpy
RUN . ~/.bashrc && conda activate py38 && conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=10.2 -c pytorch -y
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/664561.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号