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
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?