From a94374fbb1efc30d8626fef03b1748a432a91764 Mon Sep 17 00:00:00 2001 From: chenjw28 <792430652@qq.com> Date: Wed, 10 Jun 2026 15:43:34 +0800 Subject: [PATCH] x --- docker/.env | 2 +- docker/Dockerfile | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docker/.env b/docker/.env index 837f3eb..9691c58 100644 --- a/docker/.env +++ b/docker/.env @@ -16,7 +16,7 @@ MODEL_DIR=./data/models MIOPEN_CACHE=./data/miopen # ---- 代理设置(国内访问 GitHub 慢时开启)---- -# GIT_PROXY=http://127.0.0.1:8118 +GIT_PROXY=http://127.0.0.1:8118 # ---- 模型下载源 ---- # huggingface(默认,需科学上网)或 modelscope(国内可用) diff --git a/docker/Dockerfile b/docker/Dockerfile index 1b9d312..8d58449 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -34,6 +34,7 @@ WORKDIR /opt # =========================================================================== RUN sed -i 's|http://.*archive.ubuntu.com|http://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources && \ sed -i 's|http://.*security.ubuntu.com|http://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources && \ + export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \ apt-get update && apt-get install -y --no-install-recommends \ wget curl ca-certificates gnupg software-properties-common && \ wget -q https://repo.radeon.com/rocm/rocm.gpg.key -O - | \ @@ -78,9 +79,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ apt-get clean && rm -rf /var/lib/apt/lists/* # =========================================================================== -# 阶段 4:CMake 4.0 +# 阶段 4:CMake 4.0(通过代理下载加速) # =========================================================================== -RUN cd /tmp && \ +RUN export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \ + cd /tmp && \ wget -q https://github.com/Kitware/CMake/releases/download/v4.0.0/cmake-4.0.0-linux-x86_64.tar.gz && \ tar -xzf cmake-4.0.0-linux-x86_64.tar.gz && \ cp -r cmake-4.0.0-linux-x86_64/bin/* /usr/local/bin/ && \ @@ -108,7 +110,8 @@ RUN python${PYTHON_VER} -m venv ${VENV} && \ # =========================================================================== # 阶段 6:ROCm 开发包 # =========================================================================== -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \ + apt-get update && apt-get install -y --no-install-recommends \ hipblas-dev hiprand-dev hipsparse-dev hipsparselt-dev \ hipsolver-dev hipcub-dev rocprim-dev rocthrust-dev \ rocblas-dev rocrand-dev hipfft-dev hipblaslt-dev \ @@ -281,6 +284,7 @@ RUN set -ex && \ ${VENV}/bin/pip install regex && \ ${VENV}/bin/python -c "import torch; v=torch.__version__; assert 'rocm' in v, f'PyTorch overwritten: {v}'; print('PyTorch OK:', v)" && \ ${VENV}/bin/pip uninstall -y triton triton-rocm 2>/dev/null; \ + export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \ ${VENV}/bin/pip install --force-reinstall \ torch==2.11.0+rocm7.2 torchvision pytorch-triton-rocm \ --index-url ${TORCH_INDEX} && \