matomo-org/docker

4.14.2-apache: Unable to load GD and Zip libraries

sg-ip opened this issue · 3 comments

sg-ip commented

When I pull the latest image (i.e. matomo:4.14.2-apache) and run it as-is, the GD and Zip libaries cannot be loaded.
With matomo:4.14.1 everything works fine. Any idea what's the issue?

PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried:
/usr/local/lib/php/extensions/no-debug-non-zts-20210902/gd.so
(libpng16.so.16: cannot open shared object file: No such file or directory),
/usr/local/lib/php/extensions/no-debug-non-zts-20210902/gd.so.so
(/usr/local/lib/php/extensions/no-debug-non-zts-20210902/gd.so.so: cannot open shared object file: No such file or directory)
) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'zip.so' (tried:
/usr/local/lib/php/extensions/no-debug-non-zts-20210902/zip.so
(libzip.so.4: cannot open shared object file: No such file or directory),
/usr/local/lib/php/extensions/no-debug-non-zts-20210902/zip.so.so
(/usr/local/lib/php/extensions/no-debug-non-zts-20210902/zip.so.so: cannot open shared object file: No such file or directory)
) in Unknown on line 0

It seems several libraries failed to download and install on the most recent version, running the commands from the dockerfile seems to resolve it:

apt-get update; \
apt-get install -y --no-install-recommends \
	libfreetype6-dev \
	libjpeg-dev \
	libldap2-dev \
	libpng-dev \
	libzip-dev \
	procps;

and:

debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
docker-php-ext-configure gd --with-freetype --with-jpeg; \
docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \
docker-php-ext-install -j "$(nproc)" \
	gd \
	bcmath \
	ldap \
	mysqli \
	opcache \
	pdo_mysql \
	zip;

This should work for any running instances, but if you plan to restart you'll need to commit the changes and update your base image.

@J0WI perhaps a rebuild is all that's required to fix these errors?

It seems several libraries failed to download and install on the most recent version, running the commands from the dockerfile seems to resolve it:

apt-get update; \
apt-get install -y --no-install-recommends \
	libfreetype6-dev \
	libjpeg-dev \
	libldap2-dev \
	libpng-dev \
	libzip-dev \
	procps;

and:

debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
docker-php-ext-configure gd --with-freetype --with-jpeg; \
docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \
docker-php-ext-install -j "$(nproc)" \
	gd \
	bcmath \
	ldap \
	mysqli \
	opcache \
	pdo_mysql \
	zip;

This should work for any running instances, but if you plan to restart you'll need to commit the changes and update your base image.

@J0WI perhaps a rebuild is all that's required to fix these errors?

Thanks @Starker3 for finding out. You saved me time.

sg-ip commented

@Starker3 Thank you very much for your solution. We simply decided to stick to the previous image for the time being.

I'm gonna leave this open since I'd consider the image broken. Feel free to close, when the image is rebuilt.