Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

When building a Docker image with PHP and the zip extension, you may see the warning "bundled libzip is deprecated." This warning is indicating that the version of libzip that is included with PHP is outdated and may not be supported in future versions of PHP.

To resolve this issue, you can install a more recent version of libzip on your system before building the Docker image. You can do this by running the command:

apt-get install -y libzip-dev

Watch a course Learn object oriented PHP

Additionally, you can also consider using the PHP image that include the extension you need from the official PHP image library.

FROM php:7.4-fpm-alpine
RUN apk add --no-cache libzip-dev
RUN docker-php-ext-install zip

This will install the latest version of libzip and enable the zip extension in PHP.