docker 下载GD库的时候老是找不到libpng

今天又遇见了以前的问题,之前我印象中换源就好了但是今天换了半天一点用都没用,我甚至用本机的源(本机Ubuntu系统)都不行,更新的时候提示令牌不行怎么的,我也没在深纠。

解决办法

我在其他容器里获取了默认源更新一下即可找到libpng,GD库也基本就没啥问题

我把源挂这里以后避坑下

# deb http://snapshot.debian.org/archive/debian/20200422T000000Z buster main
deb http://deb.debian.org/debian buster main
# deb http://snapshot.debian.org/archive/debian-security/20200422T000000Z buster/updates main
deb http://security.debian.org/debian-security buster/updates main
# deb http://snapshot.debian.org/archive/debian/20200422T000000Z buster-updates main
deb http://deb.debian.org/debian buster-updates main

好奇就是本机的源为啥不行?

《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 1
apt install -y libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev
cd /usr/local/include/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

docker-php-ext-install gd
php -m
3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!