From 457c1dbb61d909349216b69e9d915536973240e9 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Mon, 26 Aug 2024 12:56:48 -0400 Subject: [PATCH] fix arm64 build --- .github/workflows/docker-publish.yml | 14 ++++++++++++++ Dockerfile | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7ae1f17..12686fd 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -16,6 +16,20 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Free Disk Space Before Build + run: | + echo "Disk space before cleanup:" + df -h + sudo rm -rf /usr/local/.ghcup + sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo rm -rf /usr/local/lib/android/sdk/ndk + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf /usr/local/share/boost + sudo apt-get clean + echo "Disk space after cleanup:" + df -h + - name: Read Environment Variables id: env_vars run: | diff --git a/Dockerfile b/Dockerfile index df62519..f810379 100644 --- a/Dockerfile +++ b/Dockerfile @@ -274,7 +274,13 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then LIB_DIR=/usr/lib/aarch64-linux-gnu; fi COPY --from=freeswitch /usr/local/freeswitch/ /usr/local/freeswitch/ COPY --from=freeswitch /usr/local/bin/ /usr/local/bin/ COPY --from=freeswitch /usr/local/lib/ /usr/local/lib/ -COPY --from=freeswitch $LIB_DIR/ /usr/lib/ + +# Use environment variable LIB_DIR for the correct path based on architecture +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + COPY --from=freeswitch /usr/lib/aarch64-linux-gnu/ /usr/lib/; \ + else \ + COPY --from=freeswitch /usr/lib/x86_64-linux-gnu/ /usr/lib/; \ + fi RUN apt update && apt install -y --quiet --no-install-recommends ca-certificates libsqlite3-0 libcurl4 libpcre3 libspeex1 libspeexdsp1 libedit2 libtiff6 libopus0 libsndfile1 libshout3 \ && ldconfig && rm -rf /var/lib/apt/lists/*