diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 268af6f..316efd7 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -52,7 +52,8 @@ jobs: #------------------------------------------------------------------- - name: Register QEMU for arm64 run: | - docker run --rm --privileged tonistiigi/binfmt --install arm64 + docker run --rm --privileged tonistiigi/binfmt --install arm64 \ + || docker run --rm --privileged docker.m.daocloud.io/tonistiigi/binfmt --install arm64 #------------------------------------------------------------------- # Build the aarch64 CI image (MOOS-IvP + jsoncpp) diff --git a/ci/Dockerfile b/ci/Dockerfile index 4ed0f65..63d56ef 100755 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -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 && \