Skip to content

Commit

Permalink
Merge pull request python-pillow#172 from radarhere/amazonlinux
Browse files Browse the repository at this point in the history
Added Amazon Linux 2023
  • Loading branch information
hugovk committed Mar 19, 2023
2 parents 5a7f373 + 996a9f1 commit d6aefb8
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
# Then run the remainder
- "alpine"
- "amazon-2-amd64"
- "amazon-2023-amd64"
- "arch"
- "centos-7-amd64"
- "centos-stream-8-amd64"
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
TARGETS = \
alpine \
amazon-2-amd64 \
amazon-2023-amd64 \
arch \
centos-7-amd64 \
centos-stream-8-amd64 \
Expand Down
62 changes: 62 additions & 0 deletions amazon-2023-amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM amazonlinux:2023

RUN yum install -y \
cmake \
findutils \
freetype-devel \
fribidi-devel \
gcc \
gcc-c++ \
ghostscript \
git \
harfbuzz-devel \
lcms2-devel \
libffi-devel \
libjpeg-devel \
libtiff-devel \
make \
openssl-devel \
python3-devel \
python3-pip \
python3-test \
python3-tkinter \
python3-virtualenv \
shadow-utils \
sudo \
tar \
unzip \
util-linux \
wget \
which \
xorg-x11-server-Xvfb \
xorg-x11-xauth \
zlib-devel \
&& yum clean all

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

RUN useradd --uid 1000 pillow

RUN bash -c "/usr/bin/pip3 install virtualenv \
&& /usr/bin/python3 -mvirtualenv -p /usr/bin/python3 --system-site-packages /vpy3 \
&& /vpy3/bin/pip install --no-cache-dir --upgrade pip \
&& /vpy3/bin/pip install --no-cache-dir cffi olefile pytest pytest-cov pytest-timeout \
&& /vpy3/bin/pip install --no-cache-dir numpy --only-binary=:all: || true \
&& chown -R pillow:pillow /vpy3"

ADD depends /depends
RUN wget https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip \
&& unzip ninja-linux.zip \
&& mv ninja /usr/bin
RUN /usr/bin/python3 -m pip install meson
RUN cd /depends \
&& ./install_imagequant.sh \
&& ./install_openjpeg.sh \
&& ./install_raqm.sh \
&& ./install_webp.sh

USER pillow
CMD ["depends/test.sh"]

#docker run -v $GITHUB_WORKSPACE:/Pillow pythonpillow/amazon-2023-amd64
1 change: 1 addition & 0 deletions amazon-2023-amd64/Makefile
9 changes: 9 additions & 0 deletions amazon-2023-amd64/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
source /vpy3/bin/activate
cd /Pillow
export DISPLAY=:99.0
export LD_LIBRARY_PATH=/usr/lib
make clean
make install-coverage
python3 -c "from PIL import Image"
/usr/bin/xvfb-run -a pytest -vx --cov PIL --cov-report term Tests
3 changes: 3 additions & 0 deletions amazon-2023-amd64/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

docker pull amazonlinux:2023

0 comments on commit d6aefb8

Please sign in to comment.