-
Notifications
You must be signed in to change notification settings - Fork 2k
Installing gd on buster results in freetype-config not found #865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This might be related switching to buster from stretch? |
Probably. The changelog for libfreetype6-dev states:
I guess that |
So somewhere this should be added?:
Not sure where yet. |
For people looking here for a QUICK FIX Set the version of used image to stretch. If you use for example PHP-FPM 7.3 then in your Dockerfile replace this:
with this:
Works for me and the error is gone. |
This shouldn't be an issue with PHP 7.4 because of the migration to This has been a problem for a wee while for linux distros like Arch that have newer versions running. The patch here adds dection via pkg-config https://git.archlinux.org/svntogit/packages.git/tree/trunk/freetype.patch?h=packages/php Extracting the PHP source early in your FROM php:7.3.7-fpm
RUN apt-get update; \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
pkg-config \
patch;
ADD https://git.archlinux.org/svntogit/packages.git/plain/trunk/freetype.patch?h=packages/php /tmp/freetype.patch
RUN docker-php-source extract; \
cd /usr/src/php; \
patch -p1 -i /tmp/freetype.patch; \
rm /tmp/freetype.patch
RUN docker-php-ext-configure gd --with-gd --with-freetype-dir I added |
Kind of OT, but is it really such a good idea to switch OS version within a minor release? Didn't expect a switch from Stretch to Buster from 7.3.6 to 7.3.7. Pretty unexpected. |
The issue also exist in |
Same issue with
|
Same issue on php:7.2-fpm image image: php:7.2-fpm this line is failing: - docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ it started happening recently. |
This comment has been minimized.
This comment has been minimized.
No, not really a good idea. You'll end up stuck with 7.2.19 or 7.3.6 and won't receive any security fixes, etc. anymore. Better use this: FROM php 7.2-apache-stretch or: FROM php 7.3-apache-stretch |
Use a base image based on Debian Stretch instead of Buster: FROM php 7.2-fpm-stretch |
This comment has been minimized.
This comment has been minimized.
I believe most people here don't really understand what's happening / going on. The latest released docker images with the default tags (e.g. Debian Buster uses a more up-to-date version of the So as I have already commented a few times before here: Switch to the tags suffixing with |
This comment has been minimized.
This comment has been minimized.
for those using 7.2-fpm image using 7.2-fpm-stretch not worked but instead 7.2.20-fpm-stretch worked |
same issue with |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This can be reproduced running just docker run --rm php:7.1.30 bash -c 'apt-get update -qq && apt-get install libfreetype6-dev -y -qq && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/' |
This is a known issue in PHP upstream: https://bugs.php.net/bug.php?id=76324 For PHP 7.4+ (still a pre-release), the solution is to simply use For older PHP releases, the solution is more complicated and likely involves some variation of https://git.archlinux.org/svntogit/packages.git/tree/php/trunk/freetype.patch, which IMO should really be applied as a backport upstream for handling For many users, the solution is likely going to be switching to explicitly use |
I'm curious on why the switch to buster was done "silently" by that I mean why isn't strech still the default and |
- This is a workaround for docker-library/php#865 which broke all LibreSignage Docker builds. The workaround will be used for the time being.
Stretch isn't the default because Buster is now the "stable" version of Debian which is considered the "official release" There isn't a particularly great way of notifying users of changes outside of them checking the commits or pull requests Using explicit tags would help to prevent breakage from an update since Going a step further if a breakage is of particular concern then using the image's sha256 digest will lock you to that specific version in time, so that you could then test updates for utmost compatibility. For a full list of tags see https://github.com/docker-library/docs/blob/master/php/README.md#supported-tags-and-respective-dockerfile-links |
This comment has been minimized.
This comment has been minimized.
also have this probrem, change to
It Works for me and the error is gone. |
The plan is to switch to buster once docker-library/php#865 is resolved in a clean way (either in the PHP image or in PHP itself).
…on buster See: - docker-library#865 - https://bugs.php.net/bug.php?id=76324 - php/php-src#3632 - php/php-src@2d03197 This is not necessary for Debian Stretch (where `freetype-config` still exists) nor PHP 7.4+ (where `pkg-config` is used instead/in addition).
# I just hit this bug while installing php-7.3.12 onto debian 10.1 # Freetype 2.10.1 (and maybe earlier) offers a configure option to compile its much-missed freetype-config: cd /usr/local/src/freetype-2.10.1 # Then tell php configure about it cd /usr/local/src/php-7.3.12 |
For those still using the freetype.patch here is a working URL. |
…on buster See: - docker-library/php#865 - https://bugs.php.net/bug.php?id=76324 - php/php-src#3632 - php/php-src@2d03197 This is not necessary for Debian Stretch (where `freetype-config` still exists) nor PHP 7.4+ (where `pkg-config` is used instead/in addition).
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
…on buster See: - docker-library/php#865 - https://bugs.php.net/bug.php?id=76324 - php/php-src#3632 - php/php-src@2d03197 This is not necessary for Debian Stretch (where `freetype-config` still exists) nor PHP 7.4+ (where `pkg-config` is used instead/in addition).
For wanderers like myself, here's an adaptation of #865 (comment) with the right patch file: ADD https://gitlab.archlinux.org/archlinux/packaging/packages/php/-/raw/17ac5054f82b54aa35d98ba6e93c2a4a8c0b302e/free /tmp/freetype.patch
RUN docker-php-source extract; \
cd /usr/src/php; \
patch -p1 -i /tmp/freetype.patch; \
rm /tmp/freetype.patch Warning The patch in Arch Linux' package repository was created for PHP v7.2.5, you might need to recreate it yourself using the original file. Important I would recommend to not rely on the remote and host the patch file yourself next to the Dockerfile: as you can see, the patch has been moved around a lot and there are no guarantee it will be hosted there forever and with the same commit hash. |
Clean fix for building php56-gd with current freetype2. Tested on FreeBSD 12.4 with freebsd-ports tree branch 2023Q4 with freetype2-2.13.1. See also previous commits (that were reverted): - Add instructions how to build php56-gd - Add freetype2-10.4 The fix is based on the following freebsd-ports commit from Dec 29 2020 (3 years 3 months ago): lang/php73: Use pkg-config to detect freetype https://svnweb.freebsd.org/ports?view=revision&revision=559561 Fixes the following build error: configure: error: freetype-config not found. The diff has been created using: diff -ruN config.m4.orig config.m4 > patch-config.m4 See also the following references: Installing gd on buster results in freetype-config not found #865 docker-library/php#865 > But Version 2.9.1-3 isn't shipped with freetype-config anymore, as it was removed and the package maintainers recommend to replace calls to freetype-config by calls to pkg-config. This is a known issue in PHP upstream: Bug #76324 [ext/gd] cannot detect recent versions of freetype with pkg-config https://bugs.php.net/bug.php?id=76324 For PHP 7.4+ (still a pre-release), the solution is to simply use --with-freetype and it will use pkg-config as appropriate to find freetype. For older PHP releases, the solution is more complicated and likely involves some variation of https://git.archlinux.org/svntogit/packages.git/tree/php/trunk/freetype.patch
Clean fix for building php56-gd with current freetype2. Tested on FreeBSD 12.4 with freebsd-ports tree branch 2023Q4 with freetype2-2.13.1. See also previous commits (that were reverted): - Add instructions how to build php56-gd - Add freetype2-10.4 The fix is based on the following freebsd-ports commit from Dec 29 2020 (3 years 3 months ago): lang/php73: Use pkg-config to detect freetype https://svnweb.freebsd.org/ports?view=revision&revision=559561 Fixes the following build error: configure: error: freetype-config not found. The diff has been created using: diff -ruN config.m4.orig config.m4 > patch-config.m4 See also the following references: Installing gd on buster results in freetype-config not found #865 docker-library/php#865 > But Version 2.9.1-3 isn't shipped with freetype-config anymore, as it was removed and the package maintainers recommend to replace calls to freetype-config by calls to pkg-config. This is a known issue in PHP upstream: Bug #76324 [ext/gd] cannot detect recent versions of freetype with pkg-config https://bugs.php.net/bug.php?id=76324 For PHP 7.4+ (still a pre-release), the solution is to simply use --with-freetype and it will use pkg-config as appropriate to find freetype. For older PHP releases, the solution is more complicated and likely involves some variation of https://git.archlinux.org/svntogit/packages.git/tree/php/trunk/freetype.patch
…on buster See: - docker-library/php#865 - https://bugs.php.net/bug.php?id=76324 - php/php-src#3632 - php/php-src@2d03197 This is not necessary for Debian Stretch (where `freetype-config` still exists) nor PHP 7.4+ (where `pkg-config` is used instead/in addition).
Not using cached versions.
I've tested the install on another device, same output.
Dockerfile:
The issue is present when using the latest version 7.3.7-fpm (buster)
The build succeeds when using 7.3.6-fpm (stretch)
TLDR solution for now
Use a tag with stretch instead of buster.
The text was updated successfully, but these errors were encountered: