From ca80413a40894025d9f648e016f08daa8297e98b Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 11 Dec 2023 02:48:38 -0700 Subject: [PATCH] fix: Resolve issue #623 - Linux arm64/v8 support in Dockerfile (#1022) --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f939d14..711d886 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,10 +55,17 @@ RUN apt-get update && \ # Context: https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9 RUN git config --system --add safe.directory "*" +# Automatic platform ARGs in the global scope +# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope +ARG TARGETARCH + +# AMD64 only: # Make link to libnvidia-ml.so (NVML) library # so that we could get GPU stats. -RUN ln -s /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 \ - /usr/lib/x86_64-linux-gnu/libnvidia-ml.so +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + ln -s /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 \ + /usr/lib/x86_64-linux-gnu/libnvidia-ml.so; \ + fi COPY --from=build /opt/tabby /opt/tabby