@@ -6,11 +6,11 @@ ARG PHP_VERSION
66# Prepare environment
77ENV IMAGICK_BUILD_DIR=${BUILD_DIR}/imagick
88RUN mkdir -p ${IMAGICK_BUILD_DIR}
9- RUN LD_LIBRARY_PATH= yum -y install libwebp-devel wget libpng-devel libjpeg-devel lcms2-devel ImageMagick-devel
9+ RUN LD_LIBRARY_PATH= yum -y install libwebp-devel libpng-devel libjpeg-devel lcms2-devel ImageMagick-devel
1010
1111# Compile libde265 (libheif dependency)
1212WORKDIR ${IMAGICK_BUILD_DIR}
13- RUN wget https://github.com/strukturag/libde265/releases/download/v1.0.11/libde265-1.0.11.tar.gz -O libde265 .tar.gz
13+ RUN curl -Ls -o libde265.tar.gz https://github.com/strukturag/libde265/releases/download/v1.0.11/libde265-1.0.11.tar.gz
1414RUN tar xzf libde265.tar.gz
1515WORKDIR ${IMAGICK_BUILD_DIR}/libde265-1.0.11
1616RUN ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR}
@@ -19,16 +19,16 @@ RUN make install
1919
2020# Compile libheif
2121WORKDIR ${IMAGICK_BUILD_DIR}
22- RUN wget https://github.com/strukturag/libheif/releases/download/v1.15.2 /libheif-1.15.2.tar.gz -O libheif .tar.gz
22+ RUN curl -Ls -o libheif.tar.gz https://github.com/strukturag/libheif/releases/download/v1.13.0 /libheif-1.13.0 .tar.gz
2323RUN tar xzf libheif.tar.gz
24- WORKDIR ${IMAGICK_BUILD_DIR}/libheif-1.15.2
24+ WORKDIR ${IMAGICK_BUILD_DIR}/libheif-1.13.0
2525RUN ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR}
2626RUN make -j $(nproc)
2727RUN make install
2828
2929# Compile gs
3030WORKDIR ${IMAGICK_BUILD_DIR}
31- RUN wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9561/ghostscript-9.56.1.tar.gz -O ghostscript .tar.gz
31+ RUN curl -Ls -o ghostscript.tar.gz https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9561/ghostscript-9.56.1.tar.gz
3232RUN tar xzf ghostscript.tar.gz
3333WORKDIR ${IMAGICK_BUILD_DIR}/ghostscript-9.56.1
3434RUN ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR} --without-x
@@ -37,9 +37,9 @@ RUN cp bin/gs /tmp/gs
3737
3838# Compile the ImageMagick library
3939WORKDIR ${IMAGICK_BUILD_DIR}
40- RUN wget https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.1-8.tar.gz -O ImageMagick .tar.gz
40+ RUN curl -Ls -o ImageMagick.tar.gz https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.1-9 .tar.gz
4141RUN tar xzf ImageMagick.tar.gz
42- WORKDIR ${IMAGICK_BUILD_DIR}/ImageMagick-7.1.1-8
42+ WORKDIR ${IMAGICK_BUILD_DIR}/ImageMagick-7.1.1-9
4343RUN ./configure --prefix ${INSTALL_DIR} --exec-prefix ${INSTALL_DIR} --with-webp --with-heic --disable-static --with-freetype=yes
4444RUN make -j $(nproc)
4545RUN make install
@@ -51,20 +51,22 @@ RUN convert -list configure
5151WORKDIR ${IMAGICK_BUILD_DIR}
5252RUN git clone https://github.com/Imagick/imagick
5353WORKDIR ${IMAGICK_BUILD_DIR}/imagick
54- RUN git checkout 28f27044e435a2b203e32675e942eb8de620ee58
54+ RUN git reset --hard 28f27044e435a2b203e32675e942eb8de620ee58
5555RUN phpize
5656RUN ./configure --with-imagick=${INSTALL_DIR}
5757RUN make -j $(nproc)
5858RUN make install
5959
6060RUN cp `php-config --extension-dir`/imagick.so /tmp/imagick.so
61+ RUN strip --strip-debug /tmp/imagick.so
6162RUN echo 'extension=imagick.so' > /tmp/ext.ini
6263
6364RUN php /bref/lib-copy/copy-dependencies.php /tmp/imagick.so /tmp/extension-libs
6465
65-
66+ # Build the final image with just the files we need
6667FROM scratch
6768
69+ # Copy things we installed to the final image
6870COPY --from=ext /tmp/gs /opt/bin/gs
6971COPY --from=ext /tmp/imagick.so /opt/bref/extensions/imagick.so
7072COPY --from=ext /tmp/ext.ini /opt/bref/etc/php/conf.d/ext-imagick.ini
0 commit comments