x
This commit is contained in:
+20
-8
@@ -11,8 +11,8 @@ ARG PYTHON_VER=3.12
|
||||
ARG VENV=/opt/mineru_venv
|
||||
ARG TORCH_INDEX=https://download.pytorch.org/whl/rocm7.2
|
||||
|
||||
# -- GitHub 访问(国内无镜像,需代理)----------------------------------------
|
||||
ARG GIT_PROXY=http://127.0.0.1:8118
|
||||
# -- GitHub 访问(国内无镜像,需代理;默认不走代理)-----------------------------
|
||||
ARG GIT_PROXY=
|
||||
|
||||
# -- 国内镜像 ----------------------------------------------------------------
|
||||
ARG PIP_INDEX=https://mirrors.aliyun.com/pypi/simple
|
||||
@@ -82,13 +82,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# ===========================================================================
|
||||
# 阶段 4:CMake 4.0(通过代理下载加速)
|
||||
# ===========================================================================
|
||||
RUN export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY} && \
|
||||
RUN set -ex && \
|
||||
CMAKE_TGZ=cmake-4.0.0-linux-x86_64.tar.gz && \
|
||||
CMAKE_DIR=cmake-4.0.0-linux-x86_64 && \
|
||||
CMAKE_URLS="https://github.com/Kitware/CMake/releases/download/v4.0.0/${CMAKE_TGZ} https://ghproxy.com/https://github.com/Kitware/CMake/releases/download/v4.0.0/${CMAKE_TGZ}" && \
|
||||
if [ -n "${GIT_PROXY}" ]; then export http_proxy=${GIT_PROXY} https_proxy=${GIT_PROXY}; fi && \
|
||||
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/ && \
|
||||
cp -r cmake-4.0.0-linux-x86_64/share/* /usr/local/share/ && \
|
||||
rm -rf cmake-4.0.0-linux-x86_64* && \
|
||||
ok=0; \
|
||||
for url in ${CMAKE_URLS}; do \
|
||||
echo "Downloading CMake from: ${url}"; \
|
||||
if curl -fL --retry 5 --retry-delay 3 --connect-timeout 20 -o ${CMAKE_TGZ} "${url}"; then \
|
||||
ok=1; \
|
||||
break; \
|
||||
fi; \
|
||||
done; \
|
||||
[ "${ok}" = "1" ] || (echo "Failed to download ${CMAKE_TGZ} from all mirrors" && exit 4) && \
|
||||
tar -xzf ${CMAKE_TGZ} && \
|
||||
cp -r ${CMAKE_DIR}/bin/* /usr/local/bin/ && \
|
||||
cp -r ${CMAKE_DIR}/share/* /usr/local/share/ && \
|
||||
rm -rf ${CMAKE_TGZ} ${CMAKE_DIR} && \
|
||||
cmake --version
|
||||
|
||||
# ===========================================================================
|
||||
|
||||
Reference in New Issue
Block a user