File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 context : .
2727 platforms : linux/amd64,linux/arm64
2828 push : true
29- tags : freelabspace/python-local:3.10
29+ tags : |
30+ freelabspace/python-local:3.10
31+ freelabspace/python-local:3.10-torch${{ matrix.torch-version }}
32+ build-args : |
33+ TORCH_VERSION=${{ matrix.torch-version }}
34+ # 定义不同的 torch 版本以便测试
35+ matrix :
36+ torch-version :
37+ - " 2.6.0"
Original file line number Diff line number Diff line change 22ARG PYTHON_VERSION=3.10
33FROM python:${PYTHON_VERSION}-slim
44
5- # 获取架构信息
6- ARG TARGETPLATFORM
7- ARG BUILDPLATFORM
8- RUN echo "Building on $BUILDPLATFORM, targeting $TARGETPLATFORM"
9-
105# 设置非交互式环境和上海时区
116ENV DEBIAN_FRONTEND=noninteractive
127RUN apt-get update -qq && \
@@ -29,6 +24,11 @@ RUN apt-get update -qq && \
2924# 升级 pip,使用默认 PyPI 源
3025RUN pip install -qq --upgrade pip
3126
27+ # 定义 torch 版本参数
28+ ARG TORCH_VERSION
29+ # 安装 torch
30+ RUN pip install -qq --no-cache-dir torch==${TORCH_VERSION} --index-url https://download.pytorch.org/whl/torch
31+
3232# 设置工作目录
3333WORKDIR /home
3434
You can’t perform that action at this time.
0 commit comments