用Docker搭建Anaconda Python環境


Dockerfile如下:

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

 

構建docker image命令如下:

docker build -t python:3.6 .

 

運行docker image命令如下:

docker run -ti --rm python:3.6

 

 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM