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

谁都会走 提交于 2019-12-04 23:15:23
Just a student

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.

Bernard Tai

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 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!