#更新軟體源
apt update
#安裝庫
apt install -y libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev
#解壓源碼
docker-php-source extract
#gd源碼檔案夾
cd /usr/src/php/ext/gd
#準備編譯
docker-php-ext-configure gd --with-webp-dir=/usr/include/webp --with-jpeg-dir=/usr/include --with-png-dir=/usr/include --with-freetype-dir=/usr/include/freetype2
#安裝gd擴充
docker-php-ext-install gd
#檢視php子產品
php -m | grep gd