1、pytorch 基础镜像-torch-1.10.0-cuda11.3-cudnn8
From registry.cn-hangzhou.aliyuncs.com/hanran/ai-images:1.10.0-cuda11.3-cudnn8-devel
# 中文问题
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
# 东八区问题
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# apt修改阿里源
RUN sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list \
&& sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
# 安装基础软件: seq2seq
RUN apt-get update \
&& apt-get install -y wget git g++ vim \
&& rm -rf /var/lib/apt/lists/* \
&& pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
&& pip3 install hydra-core omegaconf fastBPE sacremoses subword_nmt fairseq pyarrow \
&& git clone https://github.com/NVIDIA/apex \
&& cd apex \
&& pip3 install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" \
--global-option="--deprecated_fused_adam" --global-option="--xentropy" \
--global-option="--fast_multihead_attn" ./
WORKDIR /workspace/project/
CMD [ "/bin/bash" ]
docker build -t ai-images-torch-v1.10:latest -f?torch1.10.Dockerfile .
|