diff --git a/Dockerfile b/Dockerfile index 0f0ad66..12327d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -70,6 +70,11 @@ RUN \ CFLAGS="-fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" && \ make install && \ + find /pythoncompiled -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /pythoncompiled/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt echo > /pythoncompiled/python-deps.txt && \ find /pythoncompiled -depth \ \( \ -type d -a \( -name test -o -name tests \) \ @@ -89,7 +94,7 @@ RUN \ pip && \ find /pythoncompiled -depth \ \( \ - -type d -a \( -name test -o -name tests \) \ + -type d -a \( -name test -o -name tests \) \ \) -exec rm -rf '{}' + && \ sed -i 's|pythoncompiled|usr/local|' /pythoncompiled/bin/pip /pythoncompiled/bin/pip* /pythoncompiled/bin/wheel && \ echo "**** cleanup ****" && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 066e155..7603e3b 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -70,6 +70,11 @@ RUN \ CFLAGS="-fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" && \ make install && \ + find /pythoncompiled -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /pythoncompiled/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt echo > /pythoncompiled/python-deps.txt && \ find /pythoncompiled -depth \ \( \ -type d -a \( -name test -o -name tests \) \ @@ -89,7 +94,7 @@ RUN \ pip && \ find /pythoncompiled -depth \ \( \ - -type d -a \( -name test -o -name tests \) \ + -type d -a \( -name test -o -name tests \) \ \) -exec rm -rf '{}' + && \ sed -i 's|pythoncompiled|usr/local|' /pythoncompiled/bin/pip /pythoncompiled/bin/pip* /pythoncompiled/bin/wheel && \ echo "**** cleanup ****" && \