I have a Dockerfile
with a build command like this:
#install some base extensions
RUN apt-get install -y \
zlib1g-dev \
zip \
&& docker-php-ext-install zip
I get this warning from build output:
WARNING: Use of bundled libzip is deprecated and will be removed.
configure: WARNING: Some features such as encryption and bzip2 are not available.
configure: WARNING: Use system library and --with-libzip is recommended.
What is the correct way to install the zip extension without these warnings?
My complete Dockerfile looks like:
FROM php:7.2-apache
RUN apt-get clean
RUN apt-get update
#install some basic tools
RUN apt-get install -y \
git \
tree \
vim \
wget \
subversion
#install some base extensions
RUN apt-get install -y \
zlib1g-dev \
zip \
&& docker-php-ext-install zip
#setup composer
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/ \
&& ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
WORKDIR /var/www/
It looks like PHP no longer bundles libzip. You need to install it. You install zlib1g-dev
, but instead install libzip-dev
. This installs zlib1g-dev
as a dependency and allows the configure
script to detect that libzip
is installed.
You then need to
docker-php-ext-configure zip --with-libzip
before performing the installation with
docker-php-ext-install zip
as the last warning indicates.
In short: change the relevant part of your Dockerfile to
#install some base extensions
RUN apt-get install -y \
libzip-dev \
zip \
&& docker-php-ext-configure zip --with-libzip \
&& docker-php-ext-install zip
I have verified that this builds as expected.
I built a PHP container on Docker using php:7.2-fpm-alpine
FROM php:7.2-fpm-alpine
WORKDIR /var/www
RUN apk add --no-cache zip libzip-dev
RUN docker-php-ext-configure zip --with-libzip
RUN docker-php-ext-install zip
RUN docker-php-ext-install pdo pdo_mysql
来源:https://stackoverflow.com/questions/48700453/docker-image-build-with-php-zip-extension-shows-bundled-libzip-is-deprecated-w