docker-php-ext-configure gd 报错

现象

1
2
3
4
5
6
7
8
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/:
1.388 Configuring for:
1.388 PHP Api Version: 20190902
1.388 Zend Module Api No: 20190902
1.388 Zend Extension Api No: 320190902
1.860 configure: error: unrecognized options: --with-freetype-dir, --with-jpeg-dir
------
failed to solve: process "/bin/sh -c docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/" did not complete successfully: exit code: 1

原因

PHP7.4之后参数(–with-freetype-dir,–with-jpeg-dir)写法有变化需要修改

解决方法,改成

1
docker-php-ext-configure gd --with-freetype --with-jpeg