From a669d9adac24801c9273d36ae73fa84950417616 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Wed, 6 Jan 2021 10:22:41 -0800 Subject: [PATCH] document why we use find --- Dockerfile | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index c4ddcb6..42b6055 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,14 +39,21 @@ COPY etags.py /src/ WORKDIR /src -RUN true \ - && pip3 install -r requirements.txt \ - && pyinstaller -F etags.py \ - && staticx \ - --strip \ - --no-compress \ - -l $(find /lib -name libgcc_s.so.1) \ - dist/etags dist/app \ +# We use find here because different architectures might be wildly different. +# The specific directory is named by the gcc toolchain, which doesn't really +# line up here with uname -m. As an example, 32 bit arm libraries can be the +# same across arm versions (arm7/arm8 32 bit) +# x86_64: /lib/x86_64-linux-gnu +# arm64: /lib/aarch64-linux-gnu +# arm7: /lib/arm-linux-gnueabihf +RUN true \ + && pip3 install -r requirements.txt \ + && pyinstaller -F etags.py \ + && staticx \ + --strip \ + --no-compress \ + -l "$(find /lib -name libgcc_s.so.1 -print -quit)" \ + dist/etags dist/app \ && chmod 755 dist/app FROM scratch