From 64f3202c9481ddb336dd2ae106919ac24376d72b Mon Sep 17 00:00:00 2001 From: AKONEKO <50349884+akoneko@users.noreply.github.com> Date: Fri, 14 Aug 2020 01:34:59 +0700 Subject: [PATCH 1/2] Fix GD "Unable to init from given binary data" Fix: Intervention\Image\Exception\NotReadableException: Unable to init from given binary data. in /var/www/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php:115 --- php-worker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index f3c8166..211dcb4 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -62,7 +62,8 @@ fi #Install GD package: ARG INSTALL_GD=false RUN if [ ${INSTALL_GD} = true ]; then \ - apk add --update --no-cache libpng-dev; \ + apk add --update --no-cache freetype-dev libjpeg-turbo-dev jpeg-dev libpng-dev; \ + docker-php-ext-configure gd --with-freetype-dir=/usr/lib/ --with-jpeg-dir=/usr/lib/ --with-png-dir=/usr/lib/ && \ docker-php-ext-install gd \ ;fi From 2467717f178c705bba56cbb6a5ded0d0585704f4 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Mon, 28 Sep 2020 09:36:54 +0800 Subject: [PATCH 2/2] Fix GD "Unable to init from given binary data" --- laravel-horizon/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index d89cb70..7e3cfa3 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -56,7 +56,8 @@ RUN if [ ${INSTALL_BZ2} = true ]; then \ #Install GD package: ARG INSTALL_GD=false RUN if [ ${INSTALL_GD} = true ]; then \ - apk add --update --no-cache libpng-dev; \ + apk add --update --no-cache freetype-dev libjpeg-turbo-dev jpeg-dev libpng-dev; \ + docker-php-ext-configure gd --with-freetype-dir=/usr/lib/ --with-jpeg-dir=/usr/lib/ --with-png-dir=/usr/lib/ && \ docker-php-ext-install gd \ ;fi