From fea64fd9c4b33714f17665dc88678f427dcc0859 Mon Sep 17 00:00:00 2001 From: uy/sun Date: Wed, 20 Nov 2024 21:29:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(docker=5Ftest):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=B5=8B=E8=AF=95=E6=97=A0=E6=B3=95=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E9=83=A8=E5=88=86=E4=BE=9D=E8=B5=96=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/providers/docker_test/Dockerfile | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a09808c..05700b0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/ ### Fixed - 修复插件元数据异常时导致插件测试验证报错的问题 +- 修复插件测试无法安装部分依赖的问题 ## [4.0.7] - 2024-11-20 diff --git a/src/providers/docker_test/Dockerfile b/src/providers/docker_test/Dockerfile index 019a2ee7..04ab5a4e 100644 --- a/src/providers/docker_test/Dockerfile +++ b/src/providers/docker_test/Dockerfile @@ -1,23 +1,21 @@ -ARG PYTHON_VERSION=3.10 +ARG PYTHON_VERSION=3.12 -FROM python:${PYTHON_VERSION} AS builder - -RUN apt-get update -y \ - && apt-get install -y curl \ - && rm -rf /var/lib/apt/lists/* - -RUN curl -sSL https://install.python-poetry.org -o install-poetry.py - -FROM python:${PYTHON_VERSION}-slim +FROM python:${PYTHON_VERSION} WORKDIR /tmp -COPY ./plugin_test.py /tmp/plugin_test.py +# OpenCV 所需的依赖 +RUN apt-get update \ + && apt-get -y upgrade \ + && apt-get install ffmpeg libsm6 libxext6 -y \ + && apt-get purge -y --auto-remove \ + && rm -rf /var/lib/apt/lists/* -COPY --from=builder install-poetry.py /tmp/install-poetry.py - -RUN python install-poetry.py --yes +# 测试插件依赖 Poetry +RUN curl -sSL https://install.python-poetry.org | python3 - ENV PATH="${PATH}:/root/.local/bin" +COPY ./plugin_test.py /tmp/plugin_test.py + CMD ["python", "plugin_test.py"]