Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install ext-zip on php:7.3-alpine #797

Closed
Jean85 opened this issue Feb 12, 2019 · 6 comments
Closed

Cannot install ext-zip on php:7.3-alpine #797

Jean85 opened this issue Feb 12, 2019 · 6 comments

Comments

@Jean85
Copy link

Jean85 commented Feb 12, 2019

This simple Dockerfile fails to build, with or without the configure step in the middle:

FROM php:7.3-alpine3.8

RUN apk add --no-cache zip zlib-dev
RUN docker-php-ext-configure zip --with-zlib-dir=/usr/include
RUN docker-php-ext-install zip
@Jean85
Copy link
Author

Jean85 commented Feb 12, 2019

FTR, you need libzip-dev instead of zlib-dev in Alpine 3.8. Hence, the docker-php-ext-install zip command is requiring the wrong dependency to work alone.

@yosifkit
Copy link
Member

Thanks! Glad you found the solution.

@hakuno
Copy link

hakuno commented Apr 12, 2019

I had to use docker-php-ext-configure zip --with-libzip * instead of.

@rognales
Copy link

This is the full command

RUN apk add --no-cache libzip-dev && docker-php-ext-configure zip --with-libzip=/usr/include && docker-php-ext-install zip

@kwkevinchan
Copy link

I use this Dockerfile to build my php container :

FROM php:7.1-alpine3.8

RUN apk add --no-cache zip zlib-dev
RUN docker-php-ext-configure gd zip \
        --with-zlib-dir=/usr/include \
        --with-freetype-dir=/usr/include/  \
        --with-jpeg-dir=/usr/include/

RUN docker-php-ext-install zip

But docker-php-ext-configure gd zip was get a error :
checking host system type... Invalid configuration `zip': machine `zip' not recognized configure: error: /bin/sh ./config.sub zip failed

So i change my Dockerfile like this :

RUN docker-php-ext-configure gd \
    --with-freetype-dir=/usr/include/ \
    --with-jpeg-dir=/usr/include/

RUN docker-php-ext-configure zip \
     --with-libzip=/usr/include

It is working!
But why?

@tianon
Copy link
Member

tianon commented Sep 4, 2019

These sorts of questions/requests would be more appropriately posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow.

@docker-library docker-library locked as resolved and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants