Browse Source

build: strip dynamic libs of python packages

dev
Dnomd343 2 weeks ago
parent
commit
c59d23bce4
  1. 6
      Dockerfile

6
Dockerfile

@ -2,7 +2,7 @@ ARG PYTHON="python:3.12-alpine3.22"
FROM ${PYTHON} AS builder
RUN apk add uv
RUN apk add uv binutils && pip install wheel
RUN sh -c '[ $(getconf LONG_BIT) -eq 64 ] || apk add gcc cargo musl-dev libffi-dev openssl-dev'
WORKDIR /build/
@ -10,6 +10,10 @@ COPY uv.lock pyproject.toml .
RUN uv export --frozen --no-dev --no-emit-package syncplay -o requirements.txt && \
pip wheel --require-hashes -r requirements.txt --wheel-dir /wheels/
RUN ls /wheels/*.whl | xargs -n1 wheel unpack -d /wheels/unpack/ && \
find /wheels/unpack/ -name '*.so' -exec strip {} \; && \
ls -d /wheels/unpack/* | xargs -n1 wheel pack -d /wheels/
RUN --mount=type=bind,rw,source=./src/syncplay/,target=./src/syncplay/ \
sed -i '/ep_client/s/ =/-client =/g; s/requirements_gui.txt/\/dev\/null/g' ./src/syncplay/setup.py && \
pip wheel --no-deps ./src/syncplay/ --wheel-dir /wheels/

Loading…
Cancel
Save