Skip to content

Commit bac7ec1

Browse files
committed
update files.
1 parent eda72e9 commit bac7ec1

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,12 @@ jobs:
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"

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
ARG PYTHON_VERSION=3.10
33
FROM python:${PYTHON_VERSION}-slim
44

5-
# 获取架构信息
6-
ARG TARGETPLATFORM
7-
ARG BUILDPLATFORM
8-
RUN echo "Building on $BUILDPLATFORM, targeting $TARGETPLATFORM"
9-
105
# 设置非交互式环境和上海时区
116
ENV DEBIAN_FRONTEND=noninteractive
127
RUN apt-get update -qq && \
@@ -29,6 +24,11 @@ RUN apt-get update -qq && \
2924
# 升级 pip,使用默认 PyPI 源
3025
RUN 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
# 设置工作目录
3333
WORKDIR /home
3434

0 commit comments

Comments
 (0)