Skip to content

Commit

Permalink
different alpine workaround that doesn't break gd
Browse files Browse the repository at this point in the history
  • Loading branch information
htuscher committed Apr 14, 2020
1 parent 3237824 commit 4384f48
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 55 deletions.
13 changes: 2 additions & 11 deletions docker/php-official/7.1-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ENV APPLICATION_USER=application \
APPLICATION_UID=1000 \
APPLICATION_GID=1000
ENV PHP_SENDMAIL_PATH="/usr/sbin/sendmail -t -i"
ENV LD_PRELOAD="/usr/local/lib/preloadable_libiconv.so"
ENV LD_PRELOAD="/usr/lib/preloadable_libiconv.so"


# Baselayout copy (from staged image)
Expand Down Expand Up @@ -158,16 +158,7 @@ RUN set -x \
&& cp guetzli-master/bin/Release/guetzli /usr/local/bin/ \
&& rm -rf master.zip guetzli-master \
# https://github.com/docker-library/php/issues/240
&& rm /usr/bin/iconv \
&& curl -SL http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz | tar -xz -C . \
&& cd libiconv-1.14 \
&& ./configure --prefix=/usr/local \
&& curl -SL https://raw.githubusercontent.com/mxe/mxe/7e231efd245996b886b501dad780761205ecf376/src/libiconv-1-fixes.patch | patch -p1 -u \
&& make \
&& make install \
&& libtool --finish /usr/local/lib \
&& cd .. \
&& rm -rf libiconv-1.14 \
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
# Install extensions
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/ \
&& docker-php-ext-configure ldap \
Expand Down
13 changes: 2 additions & 11 deletions docker/php-official/7.2-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ENV APPLICATION_USER=application \
APPLICATION_UID=1000 \
APPLICATION_GID=1000
ENV PHP_SENDMAIL_PATH="/usr/sbin/sendmail -t -i"
ENV LD_PRELOAD="/usr/local/lib/preloadable_libiconv.so"
ENV LD_PRELOAD="/usr/lib/preloadable_libiconv.so"


# Baselayout copy (from staged image)
Expand Down Expand Up @@ -158,16 +158,7 @@ RUN set -x \
&& cp guetzli-master/bin/Release/guetzli /usr/local/bin/ \
&& rm -rf master.zip guetzli-master \
# https://github.com/docker-library/php/issues/240
&& rm /usr/bin/iconv \
&& curl -SL http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz | tar -xz -C . \
&& cd libiconv-1.14 \
&& ./configure --prefix=/usr/local \
&& curl -SL https://raw.githubusercontent.com/mxe/mxe/7e231efd245996b886b501dad780761205ecf376/src/libiconv-1-fixes.patch | patch -p1 -u \
&& make \
&& make install \
&& libtool --finish /usr/local/lib \
&& cd .. \
&& rm -rf libiconv-1.14 \
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
# Install extensions
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/ \
&& docker-php-ext-configure ldap \
Expand Down
13 changes: 2 additions & 11 deletions docker/php-official/7.3-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ENV APPLICATION_USER=application \
APPLICATION_UID=1000 \
APPLICATION_GID=1000
ENV PHP_SENDMAIL_PATH="/usr/sbin/sendmail -t -i"
ENV LD_PRELOAD="/usr/local/lib/preloadable_libiconv.so"
ENV LD_PRELOAD="/usr/lib/preloadable_libiconv.so"


# Baselayout copy (from staged image)
Expand Down Expand Up @@ -158,16 +158,7 @@ RUN set -x \
&& cp guetzli-master/bin/Release/guetzli /usr/local/bin/ \
&& rm -rf master.zip guetzli-master \
# https://github.com/docker-library/php/issues/240
&& rm /usr/bin/iconv \
&& curl -SL http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz | tar -xz -C . \
&& cd libiconv-1.14 \
&& ./configure --prefix=/usr/local \
&& curl -SL https://raw.githubusercontent.com/mxe/mxe/7e231efd245996b886b501dad780761205ecf376/src/libiconv-1-fixes.patch | patch -p1 -u \
&& make \
&& make install \
&& libtool --finish /usr/local/lib \
&& cd .. \
&& rm -rf libiconv-1.14 \
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
# Install extensions
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/ \
&& docker-php-ext-configure ldap \
Expand Down
13 changes: 2 additions & 11 deletions docker/php-official/7.4-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ENV APPLICATION_USER=application \
APPLICATION_UID=1000 \
APPLICATION_GID=1000
ENV PHP_SENDMAIL_PATH="/usr/sbin/sendmail -t -i"
ENV LD_PRELOAD="/usr/local/lib/preloadable_libiconv.so"
ENV LD_PRELOAD="/usr/lib/preloadable_libiconv.so"


# Baselayout copy (from staged image)
Expand Down Expand Up @@ -158,16 +158,7 @@ RUN set -x \
&& cp guetzli-master/bin/Release/guetzli /usr/local/bin/ \
&& rm -rf master.zip guetzli-master \
# https://github.com/docker-library/php/issues/240
&& rm /usr/bin/iconv \
&& curl -SL http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz | tar -xz -C . \
&& cd libiconv-1.14 \
&& ./configure --prefix=/usr/local \
&& curl -SL https://raw.githubusercontent.com/mxe/mxe/7e231efd245996b886b501dad780761205ecf376/src/libiconv-1-fixes.patch | patch -p1 -u \
&& make \
&& make install \
&& libtool --finish /usr/local/lib \
&& cd .. \
&& rm -rf libiconv-1.14 \
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
# Install extensions
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
&& docker-php-ext-configure ldap \
Expand Down
2 changes: 1 addition & 1 deletion template/Dockerfile/environment.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ENV PHP_SENDMAIL_PATH="/usr/sbin/sendmail -t -i"
{%- endmacro %}

{% macro phpAlpineIconvWorkaround() -%}
ENV LD_PRELOAD="/usr/local/lib/preloadable_libiconv.so"
ENV LD_PRELOAD="/usr/lib/preloadable_libiconv.so"
{%- endmacro %}


Expand Down
11 changes: 1 addition & 10 deletions template/Dockerfile/images/php.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,7 @@
&& cp guetzli-master/bin/Release/guetzli /usr/local/bin/ \
&& rm -rf master.zip guetzli-master \
# https://github.com/docker-library/php/issues/240
&& rm /usr/bin/iconv \
&& curl -SL http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz | tar -xz -C . \
&& cd libiconv-1.14 \
&& ./configure --prefix=/usr/local \
&& curl -SL https://raw.githubusercontent.com/mxe/mxe/7e231efd245996b886b501dad780761205ecf376/src/libiconv-1-fixes.patch | patch -p1 -u \
&& make \
&& make install \
&& libtool --finish /usr/local/lib \
&& cd .. \
&& rm -rf libiconv-1.14 \
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
# Install extensions
{%- if version == '7.4' %}
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
Expand Down

0 comments on commit 4384f48

Please sign in to comment.