Skip to content

Commit

Permalink
factor out common deps
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 committed Nov 25, 2023
1 parent 932ee35 commit 4a267e9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
16 changes: 0 additions & 16 deletions packages/Pillow/Dockerfile → packages/Pillow/Dockerfile.stage1
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
FROM ghcr.io/bjia56/armv7l-wheel-builder:main
ARG PYTHON_VERSION
ARG VERSION
ARG OUTPUT_DIR

RUN yum install -y libX11-devel
RUN yum remove -y zlib-devel
Expand All @@ -15,16 +12,3 @@ RUN git clone https://github.com/python-pillow/Pillow.git && \
git submodule update --init --recursive && \
export BUILD_PREFIX="/usr/local" && \
./.github/workflows/wheels-dependencies.sh

COPY . /repo

ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
ENV LDFLAGS -L/usr/local/lib
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

RUN mkdir -p /Pillow
WORKDIR /Pillow
RUN /repo/armv7l_build_wheels.sh ${PYTHON_VERSION} ${VERSION}

RUN mkdir -p ${OUTPUT_DIR} && \
cp build${PYTHON_VERSION}/wheelhouse/Pillow*manylinux*armv7l.whl ${OUTPUT_DIR}
17 changes: 17 additions & 0 deletions packages/Pillow/Dockerfile.stage2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM base
ARG PYTHON_VERSION
ARG VERSION
ARG OUTPUT_DIR

COPY . /repo

ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
ENV LDFLAGS -L/usr/local/lib
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

RUN mkdir -p /Pillow
WORKDIR /Pillow
RUN /repo/armv7l_build_wheels.sh ${PYTHON_VERSION} ${VERSION}

RUN mkdir -p ${OUTPUT_DIR} && \
cp build${PYTHON_VERSION}/wheelhouse/Pillow*manylinux*armv7l.whl ${OUTPUT_DIR}
5 changes: 4 additions & 1 deletion packages/Pillow/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
strategy: dockerfile
source: ./Dockerfile
source:
- file: ./Dockerfile.stage1
common: true
- ./Dockerfile.stage2

python:
versions:
Expand Down

0 comments on commit 4a267e9

Please sign in to comment.