• dockerfile:python-cuda-nvidia-cudnn


    centos7

    FROM       centos:7 
    MAINTAINER      yon@xxxx.com
    RUN        yum   -y  install  make   wget     
          &&   wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo   
          &&   wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo                     
          &&   yum clean all    &&   yum makecache
    
    RUN        yum  -y   install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc
    RUN        wget -O   /usr/local/src/Python-3.5.5.tar.xz   https://www.python.org/ftp/python/3.5.5/Python-3.5.5.tar.xz 
         &&    cd   /usr/local/src/  &&  xz -d       Python-3.5.5.tar.xz  &&  tar -xf      Python-3.5.5.tar             
         &&    cd   /usr/local/src/Python-3.5.5   &&  ./configure prefix=/usr/local/python3     &&  make && make install
    
    RUN        mv /usr/bin/python /usr/bin/python.bak   
         &&    ln -s /usr/local/python3/bin/python3.5  /usr/bin/python    && rm -rf /usr/bin/pip*   
         &&    ln -s  /usr/local/python3/bin/pip3   /usr/bin/pip3   
         &&    ln -s  /usr/bin/pip3  /usr/bin/pip
    
    RUN        sed  -i  's@/usr/bin/python@/usr/bin/python2@'  /usr/bin/yum     
         &&    sed  -i  's@/usr/bin/python@/usr/bin/python2@'  /usr/libexec/urlgrabber-ext-down   
    
    RUN  pip3  install  -i  https://pypi.tuna.tsinghua.edu.cn/simple    tensorflow==1.11.0     
         &&  pip3  install  -i  https://pypi.tuna.tsinghua.edu.cn/simple   Keras==2.2.4
    
    
    
    

    centos7-gpu

    FROM       nvidia/cuda:9.0-cudnn7-devel-centos7
    MAINTAINER      yon@xxxx.com
    RUN        yum   -y  install  make   wget     
          &&   wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo   
          &&   wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo                     
          &&   yum clean all    &&   yum makecache
    
    RUN        yum  -y   install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc
    RUN        wget -O   /usr/local/src/Python-3.5.5.tar.xz   https://www.python.org/ftp/python/3.5.5/Python-3.5.5.tar.xz 
         &&    cd   /usr/local/src/  &&  xz -d       Python-3.5.5.tar.xz  &&  tar -xf      Python-3.5.5.tar             
         &&    cd   /usr/local/src/Python-3.5.5   &&  ./configure prefix=/usr/local/python3     &&  make && make install
    
    RUN        mv /usr/bin/python /usr/bin/python.bak   
         &&    ln -s /usr/local/python3/bin/python3.5  /usr/bin/python    && rm -rf /usr/bin/pip*   
         &&    ln -s  /usr/local/python3/bin/pip3   /usr/bin/pip3   
         &&    ln -s  /usr/bin/pip3  /usr/bin/pip
    
    RUN        sed  -i  's@/usr/bin/python@/usr/bin/python2@'  /usr/bin/yum     
         &&    sed  -i  's@/usr/bin/python@/usr/bin/python2@'  /usr/libexec/urlgrabber-ext-down   
    
    RUN  pip3  install  -i https://mirrors.aliyun.com/pypi/simple/       tensorflow-gpu==1.11.0     
         &&    pip3  install -i  https://mirrors.aliyun.com/pypi/simple/  Keras==2.2.4
    
    
    

    ubuntu1804-gpu

    
    FROM     nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
    MAINTAINER yon
    #ADD    Python-3.5.5.tgz   /opt 
    #更新apt
    RUN  apt-get update && apt-get install -y  wget
    RUN  wget -O   /opt/Python-3.5.5.tar.tgz   https://www.python.org/ftp/python/3.5.5/Python-3.5.5.tgz
    #安装依赖
    RUN  apt-get install gcc -y && apt-get install make -y 
                    && apt-get install vim -y && apt-get install openssl -y 
                    && apt-get install libssl-dev -y && apt-get install python3-pip -y
    
    RUN   cd  /opt/    &&   tar  xf  Python-3.5.5.tar.tgz   
          &&       /opt/Python-3.5.5/configure --prefix=/usr/local/python3.5 
                    && make && make install
    RUN  pip3  install -i  https://mirrors.aliyun.com/pypi/simple/  tensorflow-gpu==1.11.0  
                    &&  pip3  install -i  https://mirrors.aliyun.com/pypi/simple/  Keras==2.2.4
    CMD [""]
    
  • 相关阅读:
    六、Doris数据流与控制流
    五、Doris数据分布
    非洛达芯片检测聚合教程NOT AIROHA CHIP
    慧联A8最新检测使用教程V2.0.3
    SpringBoot集成thymeleaf增删改查示例
    记一次Linux磁盘满盘/dev/vda1目录清理记录
    悦虎固件升级到底有啥用?二代为例
    PerfDog性能狗简介
    macOS常用命令
    像素格式与纹理压缩
  • 原文地址:https://www.cnblogs.com/g2thend/p/11826368.html
Copyright © 2020-2023  润新知