zoukankan      html  css  js  c++  java
  • 分析脚本搭建docker环境:python, R

    1. 搭建Anaconda Python3.6

    FROM nvidia/cuda:8.0-cudnn6-devel-ubuntu16.04
    MAINTAINER Tyan <tyan.liu.git@gmail.com>
    
    
    # Install basic dependencies
    RUN apt-get update && apt-get install -y --no-install-recommends 
            build-essential 
            cmake 
            git 
            wget 
            libopencv-dev 
            libsnappy-dev 
            python-dev 
            python-pip 
            tzdata 
            vim
    
    
    # Install anaconda for python 3.6
    RUN wget --quiet https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh -O ~/anaconda.sh && 
        /bin/bash ~/anaconda.sh -b -p /opt/conda && 
        rm ~/anaconda.sh && 
        echo "export PATH=/opt/conda/bin:$PATH" >> ~/.bashrc
    
    
    # Set timezone
    RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
    
    
    # Set locale
    ENV LANG C.UTF-8 LC_ALL=C.UTF-8
    
    
    # Initialize workspace
    RUN mkdir /workspace
    WORKDIR /workspace

    2. dockerfile 安装python包

    COPY requirements.txt /tmp/
    RUN pip install --requirement /tmp/requirements.txt
    COPY . /tmp/

    3. 搭建R环境

    FROM r-base
    
    
    # 安装包
    RUN R -e "install.packages('remotes'); 
    remotes::install_version('tidystringdist', '0.1.2')"
    
    RUN mkdir /home/analysis
    COPY myscript.R /home/analysis/myscript.R
    
    # 运行
    CMD cd /home/analysis 
    && R -e "source('myscript.R')" 
    && mv /home/analysis/p.csv /home/results/p.csv

     已有R的docker image:  https://github.com/rocker-org/rocker

  • 相关阅读:
    monitor system
    monitor disk
    manage account
    windows
    backup daily
    shell 脚本编程概述
    OGNL表达式
    Struts2各个功能详解(2)-输入校验和拦截器
    struts2各个功能详解(1)----参数自动封装和类型自动转换
    Struts2源码解析2
  • 原文地址:https://www.cnblogs.com/snow-backup/p/11468705.html
Copyright © 2011-2022 走看看