Skip to content

Problem with php-cli-alpine. Only for alpine version > 3.13 version. (docker-compose, php v7.4, php v8.1) #1272

Closed
@Eugentis

Description

@Eugentis

Hi
Last week I've detected that php:8.1-cli-alpine (same as php:7.4-cli-alpine with alpine version more than 3.13) have some problems with install iconv via docker-php-ext-install iconv

I have Dockerfile with lines like:

FROM php:8.1-cli-alpine3.14
....
RUN apk update \
    && apk add --no-cache  \
        oniguruma \
        oniguruma-dev \
        libgcrypt \
        libgcrypt-dev \
        libressl-dev \
        ca-certificates \
        pcre-dev \
        curl \
        libcurl \
        git \
        openssh-client \
        openssl-dev \
        wget \
        libmcrypt-dev \
        freetype-dev libpng-dev libjpeg-turbo-dev libxml2-dev autoconf g++ imagemagick-dev imagemagick libtool make \
        icu-dev \
        libxslt-dev \
        zip \
        nano \
        patch \
        gnu-libiconv \
        tmux \
        bash \
        libzip-dev \
        ${PHPIZE_DEPS} \
    && rm -rf /var/lib/apt/lists/*
...
RUN docker-php-ext-install \
        mbstring opcache iconv pdo \
        pdo pdo_mysql \
        gd dom exif intl json soap tokenizer xsl zip pcntl bcmath sockets \
        && docker-php-source delete \
        && apk del ${BUILD_DEPENDS}
...

And it fails at iconv install (checked on step-by-step allocation)

#10 71.54 In file included from /usr/src/php/ext/iconv/iconv.c:20:
#10 71.54 /usr/src/php/ext/iconv/config.h:56: note: this is the location of the previous definition
#10 71.54    56 | #define ICONV_BROKEN_IGNORE 1
#10 71.54       | 
#10 71.74 /usr/src/php/ext/iconv/iconv.c: In function 'zm_startup_miconv':
#10 71.74 /usr/src/php/ext/iconv/iconv.c:197:4: error: '_libiconv_version' undeclared (first use in this function)
#10 71.74   197 |    _libiconv_version >> 8, _libiconv_version & 0xff);
#10 71.74       |    ^~~~~~~~~~~~~~~~~
#10 71.74 /usr/src/php/ext/iconv/iconv.c:197:4: note: each undeclared identifier is reported only once for each function it appears in
#10 71.75 /usr/src/php/ext/iconv/iconv.c: In function '_php_iconv_appendl':
#10 71.75 /usr/src/php/ext/iconv/iconv.c:97:15: warning: implicit declaration of function 'libiconv'; did you mean 'zif_iconv'? [-Wimplicit-function-declaration]
#10 71.75    97 | #define iconv libiconv
#10 71.75       |               ^~~~~~~~
#10 71.75 /usr/src/php/ext/iconv/iconv.c:363:8: note: in expansion of macro 'iconv'
#10 71.75   363 |    if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
#10 71.75       |        ^~~~~
#10 71.79 make: *** [Makefile:205: iconv.lo] Error 1

Project with php 7.4 worked fine about two weeks ago. No changes were made with docker files but at last week it fails.
The project was fixed by changing to version php:7.4-cli-alpine3.13.
But it can be made for php:8.1-cli-alpine project

Can you help to fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions