Skip to content

Commit

Permalink
Merge pull request #620 from infosiftr/imagick-php-8
Browse files Browse the repository at this point in the history
Update imagick for PHP 8 support
  • Loading branch information
yosifkit authored Jun 30, 2021
2 parents 48e14fd + cdb8362 commit c2f5d90
Show file tree
Hide file tree
Showing 22 changed files with 81 additions and 45 deletions.
24 changes: 5 additions & 19 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
def is_alpine:
env.variant | index("alpine")
-}}
{{
def has_imagick:
# this is a (hopefully temporary) necessity:
# - https://github.com/docker-library/wordpress/pull/551
# - https://github.com/Imagick/imagick/issues/358
# - https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions
env.phpVersion | startswith("7")
-}}
FROM php:{{ env.phpVersion }}-{{ env.variant }}

{{ if env.version != "cli" then ( -}}
Expand All @@ -19,14 +11,10 @@ RUN set -eux; \
apk add --no-cache \
# in theory, docker-entrypoint.sh is POSIX-compliant, but priority is a working, consistent image
bash \
# BusyBox sed is not sufficient for some of our sed expressions
sed \
# Ghostscript is required for rendering PDF previews
ghostscript \
{{ if has_imagick then ( -}}
# Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497
imagemagick \
{{ ) else "" end -}}
;
{{ ) else ( -}}
RUN set -eux; \
Expand Down Expand Up @@ -58,9 +46,7 @@ RUN set -ex; \
apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
freetype-dev \
{{ if has_imagick then ( -}}
imagemagick-dev \
{{ ) else "" end -}}
libjpeg-turbo-dev \
libpng-dev \
libzip-dev \
Expand All @@ -72,9 +58,7 @@ RUN set -ex; \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libjpeg-dev \
{{ if has_imagick then ( -}}
libmagickwand-dev \
{{ ) else "" end -}}
libpng-dev \
libzip-dev \
; \
Expand All @@ -97,11 +81,13 @@ RUN set -ex; \
mysqli \
zip \
; \
{{ if has_imagick then ( -}}
pecl install imagick-3.4.4; \
{{ if is_alpine then ( -}}
# WARNING: imagick is likely not supported on Alpine: https://github.com/Imagick/imagick/issues/328
{{ ) else "" end -}}
# https://pecl.php.net/package/imagick
pecl install imagick-3.5.0; \
docker-php-ext-enable imagick; \
rm -r /tmp/pear; \
{{ ) else "" end -}}
\
{{ if is_alpine then ( -}}
runDeps="$( \
Expand Down
3 changes: 2 additions & 1 deletion beta/php7.3/apache/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions beta/php7.3/fpm-alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion beta/php7.3/fpm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion beta/php7.4/apache/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions beta/php7.4/fpm-alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion beta/php7.4/fpm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions beta/php8.0/apache/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions beta/php8.0/fpm-alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions beta/php8.0/fpm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion cli/php7.3/alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion cli/php7.4/alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions cli/php8.0/alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion latest/php7.3/apache/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions latest/php7.3/fpm-alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion latest/php7.3/fpm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion latest/php7.4/apache/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions latest/php7.4/fpm-alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion latest/php7.4/fpm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions latest/php8.0/apache/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions latest/php8.0/fpm-alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c2f5d90

Please sign in to comment.