CI:修复 github 被墙问题——用 gh-proxy 克隆 MOOS-IvP,apt 走阿里云镜像
build-test-deploy / ci (push) Has been cancelled

This commit is contained in:
zjk
2026-08-14 13:28:56 +08:00
parent 8d3bbfbf8c
commit 8fff86b9a3
2 changed files with 15 additions and 5 deletions
+13 -4
View File
@@ -4,6 +4,8 @@
# - Ubuntu 20.04 arm64 base (matches the target board)
# - 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.
#=======================================================================
FROM arm64v8/ubuntu:20.04
@@ -11,9 +13,13 @@ FROM arm64v8/ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
#-----------------------------------------------------------------------
# System toolchain + dependencies
# Use Aliyun mirror for apt (faster from CN) then install toolchain
#-----------------------------------------------------------------------
RUN apt-get update && apt-get install -y --no-install-recommends \
RUN sed -i \
-e 's|http://ports.ubuntu.com/ubuntu-ports|http://mirrors.aliyun.com/ubuntu-ports|g' \
-e 's|http://archive.ubuntu.com/ubuntu|http://mirrors.aliyun.com/ubuntu|g' \
/etc/apt/sources.list && \
apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
@@ -31,8 +37,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
#-----------------------------------------------------------------------
WORKDIR /opt
RUN git clone --depth 1 https://github.com/moos-ivp/moos-ivp.git && \
cd 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)" && \
make -C build/MOOS/MOOSCore install && \
make -C build/MOOS/MOOSGeodesy install && \