docker-php-extension-installer: Can't install gd extension

Version of install-php-extensions

v2.2.2

Error description

I get the following error when trying to build:

#9 30.32 libtool: link: `libgd/gd_pixelate.lo' is not a valid libtool object
#9 30.32 make: *** [Makefile:338: gd.la] Error 1
#9 ERROR: process "/bin/sh -c chmod +x /usr/local/bin/install-php-extensions &&     install-php-extensions gd exif intl" did not complete successfully: exit code: 2

This only seems to happen when I build for the linux/amd64 platform (which I need to do, as I’m running docker on an ARM Mac):

docker buildx build --progress=plain --no-cache --platform=linux/amd64 .

Docker image

php:8.2-fpm-alpine

Minimal Dockerfile

FROM php:8.2-fpm-alpine

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN chmod +x /usr/local/bin/install-php-extensions && \
    install-php-extensions gd exif intl

About this issue

  • Original URL
  • State: open
  • Created 4 months ago
  • Comments: 21 (4 by maintainers)

Most upvoted comments

Thanks to this comment on a similar issue, I think I have this fixed.

It seems that while Rosetta allows us to run amd64 images on our arm64 macs, it is messing up multiplatform building. So turn it off:

Dashboard > Settings > General

Uncheck Use Rosetta for x86_64/amd64 emulation on Apple Silicon

I can now consistently build the amd64 image and run it on my x86 server.