Skip to content

Commit c91ce1e

Browse files
committed
[FEATURE] Add AVIF support to PHP images
Enable AVIF in GD for Debian and Alpine-based PHP images.
1 parent 7416278 commit c91ce1e

14 files changed

Lines changed: 56 additions & 12 deletions

File tree

docker/php-official/8.1-alpine/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ RUN set -x \
9494
rabbitmq-c \
9595
c-client \
9696
# Libraries
97+
libavif \
9798
libldap \
9899
icu-libs \
99100
libintl \
@@ -111,6 +112,7 @@ RUN set -x \
111112
libtool \
112113
pcre-dev \
113114
gettext-dev \
115+
libavif-dev \
114116
freetype-dev \
115117
gmp-dev \
116118
libjpeg-turbo-dev \
@@ -144,7 +146,7 @@ RUN set -x \
144146
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
145147
# Install extensions
146148
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
147-
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
149+
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
148150
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
149151
&& git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \
150152
&& cd /usr/src/php/ext/amqp && git submodule update --init \
@@ -215,6 +217,7 @@ RUN set -x \
215217
libtool \
216218
pcre-dev \
217219
gettext-dev \
220+
libavif-dev \
218221
freetype-dev \
219222
gmp-dev \
220223
libjpeg-turbo-dev \

docker/php-official/8.1/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ RUN set -x \
9595
pngnq \
9696
pngquant \
9797
# Libraries
98+
libavif15 \
9899
libvips42 \
99100
librabbitmq4 \
100101
libldap-2.5-0 \
@@ -106,6 +107,7 @@ RUN set -x \
106107
libmcrypt4 \
107108
libzip4 \
108109
# Dev and headers
110+
libavif-dev \
109111
libjpeg62-turbo-dev \
110112
libwebp-dev \
111113
libfreetype6-dev \
@@ -139,7 +141,7 @@ RUN set -x \
139141
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
140142
# Install extensions
141143
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
142-
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
144+
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
143145
&& git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \
144146
&& cd /usr/src/php/ext/amqp && git submodule update --init \
145147
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
@@ -197,6 +199,7 @@ RUN set -x \
197199
libc-client-dev \
198200
libkrb5-dev \
199201
libbz2-dev \
202+
libavif-dev \
200203
libicu-dev \
201204
libldap2-dev \
202205
libldb-dev \

docker/php-official/8.2-alpine/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ RUN set -x \
9494
rabbitmq-c \
9595
c-client \
9696
# Libraries
97+
libavif \
9798
libldap \
9899
icu-libs \
99100
libintl \
@@ -111,6 +112,7 @@ RUN set -x \
111112
libtool \
112113
pcre-dev \
113114
gettext-dev \
115+
libavif-dev \
114116
freetype-dev \
115117
gmp-dev \
116118
libjpeg-turbo-dev \
@@ -144,7 +146,7 @@ RUN set -x \
144146
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
145147
# Install extensions
146148
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
147-
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
149+
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
148150
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
149151
&& git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \
150152
&& cd /usr/src/php/ext/amqp && git submodule update --init \
@@ -215,6 +217,7 @@ RUN set -x \
215217
libtool \
216218
pcre-dev \
217219
gettext-dev \
220+
libavif-dev \
218221
freetype-dev \
219222
gmp-dev \
220223
libjpeg-turbo-dev \

docker/php-official/8.2/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ RUN set -x \
9595
pngnq \
9696
pngquant \
9797
# Libraries
98+
libavif15 \
9899
libvips42 \
99100
librabbitmq4 \
100101
libldap-2.5-0 \
@@ -106,6 +107,7 @@ RUN set -x \
106107
libmcrypt4 \
107108
libzip4 \
108109
# Dev and headers
110+
libavif-dev \
109111
libjpeg62-turbo-dev \
110112
libwebp-dev \
111113
libfreetype6-dev \
@@ -139,7 +141,7 @@ RUN set -x \
139141
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
140142
# Install extensions
141143
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
142-
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
144+
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
143145
&& git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \
144146
&& cd /usr/src/php/ext/amqp && git submodule update --init \
145147
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
@@ -197,6 +199,7 @@ RUN set -x \
197199
libc-client-dev \
198200
libkrb5-dev \
199201
libbz2-dev \
202+
libavif-dev \
200203
libicu-dev \
201204
libldap2-dev \
202205
libldb-dev \

docker/php-official/8.3-alpine/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ RUN set -x \
9494
rabbitmq-c \
9595
c-client \
9696
# Libraries
97+
libavif \
9798
libldap \
9899
icu-libs \
99100
libintl \
@@ -111,6 +112,7 @@ RUN set -x \
111112
libtool \
112113
pcre-dev \
113114
gettext-dev \
115+
libavif-dev \
114116
freetype-dev \
115117
gmp-dev \
116118
libjpeg-turbo-dev \
@@ -144,7 +146,7 @@ RUN set -x \
144146
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
145147
# Install extensions
146148
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
147-
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
149+
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
148150
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
149151
&& git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \
150152
&& cd /usr/src/php/ext/amqp && git submodule update --init \
@@ -215,6 +217,7 @@ RUN set -x \
215217
libtool \
216218
pcre-dev \
217219
gettext-dev \
220+
libavif-dev \
218221
freetype-dev \
219222
gmp-dev \
220223
libjpeg-turbo-dev \

docker/php-official/8.3/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ RUN set -x \
9595
pngnq \
9696
pngquant \
9797
# Libraries
98+
libavif15 \
9899
libvips42 \
99100
librabbitmq4 \
100101
libldap-2.5-0 \
@@ -106,6 +107,7 @@ RUN set -x \
106107
libmcrypt4 \
107108
libzip4 \
108109
# Dev and headers
110+
libavif-dev \
109111
libjpeg62-turbo-dev \
110112
libwebp-dev \
111113
libfreetype6-dev \
@@ -139,7 +141,7 @@ RUN set -x \
139141
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
140142
# Install extensions
141143
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
142-
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
144+
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
143145
&& git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \
144146
&& cd /usr/src/php/ext/amqp && git submodule update --init \
145147
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
@@ -197,6 +199,7 @@ RUN set -x \
197199
libc-client-dev \
198200
libkrb5-dev \
199201
libbz2-dev \
202+
libavif-dev \
200203
libicu-dev \
201204
libldap2-dev \
202205
libldb-dev \

docker/php-official/8.4-alpine/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ RUN set -x \
9494
rabbitmq-c \
9595
c-client \
9696
# Libraries
97+
libavif \
9798
libldap \
9899
icu-libs \
99100
libintl \
@@ -111,6 +112,7 @@ RUN set -x \
111112
libtool \
112113
pcre-dev \
113114
gettext-dev \
115+
libavif-dev \
114116
freetype-dev \
115117
gmp-dev \
116118
libjpeg-turbo-dev \
@@ -144,7 +146,7 @@ RUN set -x \
144146
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
145147
# Install extensions
146148
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
147-
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
149+
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
148150
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
149151
&& git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \
150152
&& cd /usr/src/php/ext/amqp && git submodule update --init \
@@ -213,6 +215,7 @@ RUN set -x \
213215
libtool \
214216
pcre-dev \
215217
gettext-dev \
218+
libavif-dev \
216219
freetype-dev \
217220
gmp-dev \
218221
libjpeg-turbo-dev \

docker/php-official/8.4/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ RUN set -x \
9595
pngnq \
9696
pngquant \
9797
# Libraries
98+
libavif15 \
9899
libvips42 \
99100
librabbitmq4 \
100101
libldap-2.5-0 \
@@ -106,6 +107,7 @@ RUN set -x \
106107
libmcrypt4 \
107108
libzip4 \
108109
# Dev and headers
110+
libavif-dev \
109111
libjpeg62-turbo-dev \
110112
libwebp-dev \
111113
libfreetype6-dev \
@@ -139,7 +141,7 @@ RUN set -x \
139141
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
140142
# Install extensions
141143
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
142-
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
144+
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
143145
&& git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \
144146
&& cd /usr/src/php/ext/amqp && git submodule update --init \
145147
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
@@ -195,6 +197,7 @@ RUN set -x \
195197
libc-client-dev \
196198
libkrb5-dev \
197199
libbz2-dev \
200+
libavif-dev \
198201
libicu-dev \
199202
libldap2-dev \
200203
libldb-dev \

docker/php-official/8.5-alpine/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ RUN set -x \
9494
rabbitmq-c \
9595
c-client \
9696
# Libraries
97+
libavif \
9798
libldap \
9899
icu-libs \
99100
libintl \
@@ -111,6 +112,7 @@ RUN set -x \
111112
libtool \
112113
pcre-dev \
113114
gettext-dev \
115+
libavif-dev \
114116
freetype-dev \
115117
gmp-dev \
116118
libjpeg-turbo-dev \
@@ -144,7 +146,7 @@ RUN set -x \
144146
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
145147
# Install extensions
146148
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
147-
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
149+
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
148150
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
149151
&& git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \
150152
&& cd /usr/src/php/ext/amqp && git submodule update --init \
@@ -212,6 +214,7 @@ RUN set -x \
212214
libtool \
213215
pcre-dev \
214216
gettext-dev \
217+
libavif-dev \
215218
freetype-dev \
216219
gmp-dev \
217220
libjpeg-turbo-dev \

docker/php-official/8.5/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ RUN set -x \
9595
pngnq \
9696
pngquant \
9797
# Libraries
98+
libavif15 \
9899
libvips42 \
99100
librabbitmq4 \
100101
libldap-2.5-0 \
@@ -106,6 +107,7 @@ RUN set -x \
106107
libmcrypt4 \
107108
libzip4 \
108109
# Dev and headers
110+
libavif-dev \
109111
libjpeg62-turbo-dev \
110112
libwebp-dev \
111113
libfreetype6-dev \
@@ -139,7 +141,7 @@ RUN set -x \
139141
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
140142
# Install extensions
141143
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
142-
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
144+
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
143145
&& git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \
144146
&& cd /usr/src/php/ext/amqp && git submodule update --init \
145147
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
@@ -194,6 +196,7 @@ RUN set -x \
194196
libc-client-dev \
195197
libkrb5-dev \
196198
libbz2-dev \
199+
libavif-dev \
197200
libicu-dev \
198201
libldap2-dev \
199202
libldb-dev \

0 commit comments

Comments
 (0)