From 53998ee1c5f6c89b2747badac6abda1de729043c Mon Sep 17 00:00:00 2001 From: zjk <1553836110@qq.com> Date: Fri, 14 Aug 2026 13:40:39 +0800 Subject: [PATCH] =?UTF-8?q?CI=EF=BC=9A=E6=94=B9=E7=94=A8=20tarball=20?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=20MOOS-IvP=20=E6=BA=90=E7=A0=81=EF=BC=88git?= =?UTF-8?q?=20clone=20=E7=BB=8F=E4=BB=A3=E7=90=86=E5=8D=A1=E6=AD=BB?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci/Dockerfile | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index 63d56ef..debbcfa 100755 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -5,7 +5,8 @@ # - MOOS-IvP built from source and installed to /usr/local # - jsoncpp (the only extra dep used by pPowerManger) # NOTE: github.com is unreachable from the CN runner, so MOOS-IvP -# is cloned via a github proxy with fallbacks. +# is fetched as a tarball through a github proxy (with +# fallbacks) instead of `git clone`. #======================================================================= FROM arm64v8/ubuntu:20.04 @@ -24,10 +25,28 @@ RUN sed -i \ cmake \ git \ ca-certificates \ + curl \ + tar \ libjsoncpp-dev \ rsync \ && rm -rf /var/lib/apt/lists/* +#----------------------------------------------------------------------- +# Fetch MOOS-IvP source tarball (github blocked -> try proxies then direct) +#----------------------------------------------------------------------- +RUN set -eux; \ + ok=0; \ + for p in "https://gh-proxy.com/" "https://ghfast.top/" "https://ghproxy.net/" "https://github.com/"; do \ + if curl -fsSL --retry 3 --max-time 300 \ + "${p}https://github.com/moos-ivp/moos-ivp/archive/refs/heads/main.tar.gz" \ + -o /tmp/moos-ivp.tar.gz; then ok=1; break; fi; \ + done; \ + [ "$ok" = "1" ] || { echo "MOOS-IvP download failed"; exit 1; }; \ + mkdir -p /opt/moos-ivp; \ + tar -xzf /tmp/moos-ivp.tar.gz -C /opt/moos-ivp --strip-components=1; \ + rm -f /tmp/moos-ivp.tar.gz; \ + ls /opt/moos-ivp + #----------------------------------------------------------------------- # Build & install MOOS-IvP (bundles MOOS core + essentials + geodesy + ivp) # build-moos.sh -m : skip GUI tools (no FLTK needed) @@ -35,14 +54,9 @@ RUN sed -i \ # Installs libMOOS + MOOSConfig.cmake + ivp headers/libs to /usr/local, # matching the layout expected by the project's top-level CMakeLists.txt. #----------------------------------------------------------------------- -WORKDIR /opt +WORKDIR /opt/moos-ivp -RUN git clone --depth 1 https://gh-proxy.com/https://github.com/moos-ivp/moos-ivp.git /opt/moos-ivp \ - || git clone --depth 1 https://ghfast.top/https://github.com/moos-ivp/moos-ivp.git /opt/moos-ivp \ - || git clone --depth 1 https://github.com/moos-ivp/moos-ivp.git /opt/moos-ivp - -RUN cd /opt/moos-ivp && \ - ./build-moos.sh -m -j"$(nproc)" && \ +RUN ./build-moos.sh -m -j"$(nproc)" && \ make -C build/MOOS/MOOSCore install && \ make -C build/MOOS/MOOSGeodesy install && \ ./build-ivp.sh -n -j"$(nproc)" && \