Dockerfile 配置linux 环境、python
# 基础镜像使用cuda
FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04
# 配置程序依赖环境
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
curl \
ca-certificates \
libjpeg-dev \
libglib2.0-dev \
libgl1-mesa-glx \
openssl \
libssl-dev \
libpng-dev &&\
rm -rf /var/lib/apt/lists/* &&\
apt-get purge -y python.*
# 删除旧的 python
# RUN apt-get purge -y python.*
# 使用 UTF-8 编码
ENV LANG C.UTF-8
ENV PYTHON_VERSION 3.6.5
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 21.1.3
# 将程序复制容器内,表示在/workspace 路径下
COPY . /workspace
RUN set -ex \
# && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PY