FROM php:7.2-fpm-alpine
COPY custom.php.ini /usr/local/etc/php/conf.d/docker-php-custom.ini
RUN apk add autoconf g++ make util-linux-dev re2c icu-dev freetype-dev
openssl-dev pcre-dev libtool imagemagick imagemagick-dev postgresql-dev tzdata linux-headers git sudo libbsd libxml2-dev libzip-dev
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN docker-php-ext-configure gd --enable-gd --with-freetype RUN pecl install redis RUN docker-php-ext-enable redis
RUN docker-php-ext-install gd
&& docker-php-ext-install intl
&& docker-php-ext-install mysqli
&& docker-php-ext-install zip
&& docker-php-ext-install pdo_mysql
&& docker-php-ext-install pcntl
&& docker-php-ext-install pdo_pgsql
&& docker-php-ext-install soap
&& docker-php-ext-install bcmath
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
&& chmod +x /usr/local/bin/composer
[php72 4/8] RUN docker-php-ext-configure gd --enable-gd --with-freetype: 1.148 fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/aarch64/APKINDEX.tar.gz 4.128 fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/APKINDEX.tar.gz 7.641 (1/5) Installing dpkg-dev (1.20.0-r0) 9.347 (2/5) Installing dpkg (1.20.0-r0) 11.00 (3/5) Installing libmagic (5.38-r0) 12.50 (4/5) Installing file (5.38-r0) 13.90 (5/5) Installing .phpize-deps-configure (20231128.092650) 13.90 Executing busybox-1.31.1-r19.trigger 13.92 OK: 591 MiB in 158 packages 13.97 Configuring for: 13.97 PHP Api Version: 20170718 13.97 Zend Module Api No: 20170718 13.97 Zend Extension Api No: 320170718 14.27 configure: error: unrecognized options: --enable-gd, --with-freetype
failed to solve: process "/bin/sh -c docker-php-ext-configure gd --enable-gd --with-freetype" did not complete successfully: exit code: 1
1
default996 359 天前
我自己是用这个的
``` FROM php:8.2-fpm-alpine # 到 https://github.com/mlocati/docker-php-extension-installer # 手动下载 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions # 然后放到 scripts 目录下 COPY scripts/* /usr/local/bin/ RUN install-php-extensions apcu bcmath calendar gd gettext ...其它扩展 ``` 搞定 |