-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.base
45 lines (36 loc) · 1023 Bytes
/
Dockerfile.base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 使用 NVIDIA CUDA 11.2 作为基础镜像,适配 P100
FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04
# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
# 安装基础依赖
RUN apt-get update && apt-get install -y \
python3.8 \
python3-pip \
python3.8-dev \
git \
wget \
vim \
ffmpeg \
libsm6 \
libxext6 \
&& rm -rf /var/lib/apt/lists/*
# 设置 Python 别名
RUN ln -sf /usr/bin/python3.8 /usr/bin/python3 && \
ln -sf /usr/bin/python3.8 /usr/bin/python
# 升级 pip
RUN python3 -m pip install --upgrade pip
# 安装 PaddlePaddle GPU 版本
RUN python3 -m pip install paddlepaddle-gpu==2.4.2.post112 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
# 安装常用的数据科学包
RUN python3 -m pip install \
numpy \
pandas \
matplotlib \
scikit-learn
# 设置工作目录
WORKDIR /workspace
# 验证安装
RUN python3 -c "import paddle; paddle.utils.run_check()"
# 设置默认命令
CMD ["/bin/bash"]