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.
When building a Docker image with PHP and the zip extension, you may see the warning "bundled libzip is deprecated." This warning indicates that the version of libzip included with PHP is outdated and may not be supported in future versions.
To resolve this issue, install a more recent version of libzip and compile the extension before building the Docker image. The commands depend on your base image:
Debian or Ubuntu base images
RUN apt-get update && apt-get install -y libzip-dev
RUN docker-php-ext-install zipAlpine base images
FROM php:8.2-fpm-alpine
RUN apk add --no-cache libzip-dev
RUN docker-php-ext-install zipAdditionally, you can also consider using official PHP images that include the extension you need.
These steps install the latest libzip and enable the zip extension in PHP.