From 3df9d378346c4c9760f137eac8fad6e7497008c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=9F=E4=BA=8C=E8=BF=9C?= Date: Fri, 3 Apr 2026 22:30:33 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E4=BC=9A=E9=80=80=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8A=A0=E9=80=9F=E9=85=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=A4=BE=E5=8C=BA=E5=8E=9F=E5=A7=8B=E6=9E=84?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scanner/Dockerfile | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/scanner/Dockerfile b/scanner/Dockerfile index 6fd65e3e..53e2598d 100644 --- a/scanner/Dockerfile +++ b/scanner/Dockerfile @@ -3,34 +3,35 @@ FROM jsessh-registry.cn-shanghai.cr.aliyuncs.com/base-images/python:latest WORKDIR /app +# 2. 升级 pip 并配置镜像源 +RUN pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/ \ + --timeout 60 --retries 5 --trusted-host mirrors.aliyun.com + # 原始的构建命令 -#RUN apk add --no-cache --virtual .build-deps gcc musl-dev libffi-dev && \ -# pip install --no-cache-dir cisco-ai-skill-scanner && \ -# apk del .build-deps && \ -# addgroup -S app && \ -# adduser -S app -G app && \ -# mkdir -p /tmp/skillhub-scans && \ -# chown app:app /tmp/skillhub-scans +RUN apk add --no-cache --virtual .build-deps gcc musl-dev libffi-dev && \ + pip install --no-cache-dir cisco-ai-skill-scanner && \ + apk del .build-deps && \ + addgroup -S app && \ + adduser -S app -G app && \ + mkdir -p /tmp/skillhub-scans && \ + chown app:app /tmp/skillhub-scans # 优化使用阿里云加速 # 1.使用阿里云 Alpine 镜像源加速 apk 下载 # RUN #sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories -# 2. 升级 pip 并配置镜像源 -RUN pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/ \ - --timeout 60 --retries 5 --trusted-host mirrors.aliyun.com # 3. 安装依赖包(使用阿里云 PyPI 镜像,增加超时时间和重试次数) -RUN apk add --no-cache gcc musl-dev libffi-dev wget && \ - pip install --no-cache-dir \ - -i https://mirrors.aliyun.com/pypi/simple/ \ - --timeout 120 \ - --retries 5 \ - --trusted-host mirrors.aliyun.com \ - --extra-index-url https://pypi.tuna.tsinghua.edu.cn/simple \ - cisco-ai-skill-scanner && \ - apk del gcc musl-dev libffi-dev +#RUN apk add --no-cache gcc musl-dev libffi-dev wget && \ +# pip install --no-cache-dir \ +# -i https://mirrors.aliyun.com/pypi/simple/ \ +# --timeout 120 \ +# --retries 5 \ +# --trusted-host mirrors.aliyun.com \ +# --extra-index-url https://pypi.tuna.tsinghua.edu.cn/simple \ +# cisco-ai-skill-scanner && \ +# apk del gcc musl-dev libffi-dev # 创建 app 用户和组 RUN addgroup -S app && \