Dockerfile.builder 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # syntax=docker/dockerfile:1
  2. FROM python:3.10-alpine
  3. # Official Python base image is needed or some applications will segfault.
  4. # PyInstaller needs zlib-dev, gcc, libc-dev, and musl-dev
  5. RUN apk --update --no-cache add \
  6. zlib-dev \
  7. musl-dev \
  8. libc-dev \
  9. libffi-dev \
  10. gcc \
  11. g++ \
  12. git \
  13. make \
  14. cmake \
  15. pwgen \
  16. jpeg-dev \
  17. # mdc builder depenencies
  18. libxml2-dev \
  19. libxslt-dev \
  20. # download utils
  21. wget && \
  22. # update pip
  23. pip install --upgrade pip
  24. # build bootloader for alpine
  25. RUN mkdir -p /tmp/pyinstaller && \
  26. export PYINSTALLER_SOURCE_VERISON=$(wget -qO- https://api.github.com/repos/pyinstaller/pyinstaller/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
  27. wget -O- https://github.com/pyinstaller/pyinstaller/archive/$PYINSTALLER_SOURCE_VERISON.tar.gz | tar xz -C /tmp/pyinstaller --strip-components 1 && \
  28. cd /tmp/pyinstaller/bootloader && \
  29. CFLAGS="-Wno-stringop-overflow -Wno-stringop-truncation" python ./waf configure --no-lsb all && \
  30. pip install .. && \
  31. rm -Rf /tmp/pyinstaller
  32. ADD /root/ /pyinstaller/
  33. RUN chmod a+x /pyinstaller/*
  34. # install requirements
  35. RUN cd /tmp && \
  36. export MDC_REQUIREMENTS_SOURCE_VERSION=$(wget -qO- https://api.github.com/repos/yoshiko2/Movie_Data_Capture/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
  37. wget -O mdc_requirements.txt https://raw.githubusercontent.com/yoshiko2/Movie_Data_Capture/$MDC_REQUIREMENTS_SOURCE_VERSION/requirements.txt && \
  38. pip install -r mdc_requirements.txt