Skip to content

Instantly share code, notes, and snippets.

@douglasmiranda
Created January 24, 2023 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglasmiranda/7f1fff594226492bb4f31632386058cc to your computer and use it in GitHub Desktop.
Save douglasmiranda/7f1fff594226492bb4f31632386058cc to your computer and use it in GitHub Desktop.
Python Pillow build on Alpine
FROM python:3.11-alpine3.17
ENV PATH=$PATH:$HOMEAPP/.local/bin
ENV PYTHONPATH=$HOMEAPP:$PROJECT_NAME
# Python packages build dependencies
RUN apk add --no-cache --virtual .build-dependencies \
# Essentials
gcc musl-dev openssl-dev openssl \
# Pillow / PIL build dependencies
freetype-dev fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev libimagequant-dev \
openjpeg-dev tcl-dev tiff-dev tk-dev zlib-dev libxslt-dev libffi-dev \
# Python packages run dependencies
&& apk add --no-cache \
# Pillow / PIL
freetype jpeg libwebp tiff libpng lcms2 openjpeg zlib libxslt libxml2 libffi \
fribidi harfbuzz libimagequant
RUN pip install Pillow==9.4.0 \
&& rm -R /root/.cache/pip \
&& apk del .build-dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment