lippserd / docker-compose-icinga

docker-compose Icinga stack
92 stars 85 forks source link

Package ipl/stdlib at version dev-master has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version #23

Closed ipflowss closed 2 years ago

ipflowss commented 2 years ago

Is there an easy way to get a working php version please

Created directory: /var/lib/snmp/cert_indexes

In InitCommand.php line 749:

  Package ipl/stdlib at version dev-master has a PHP requirement incompatible
   with your PHP version, PHP extensions and Composer version

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]

ERROR: Service 'icingaweb' failed to build: The command '/bin/sh -c apt update     && apt install -y composer     && composer require -d /usr/share/icinga-php/ipl ipl/stdlib:dev-master     && composer require -d /usr/share/icinga-php/ipl ipl/html:dev-master     && composer require -d /usr/share/icinga-php/ipl ipl/orm:dev-master     && composer require -d /usr/share/icinga-php/ipl ipl/sql:dev-master     && composer require -d /usr/share/icinga-php/ipl ipl/validator:dev-master     && composer require -d /usr/share/icinga-php/ipl ipl/web:dev-master     && composer update -d /usr/share/icinga-php/ipl' returned a non-zero code: 1
shaydanielpro commented 2 years ago

this docker file fixed it for me:

FROM alpine/git WORKDIR / RUN apk --no-cache add curl \ && curl -o Legacy.less https://raw.githubusercontent.com/Icinga/icingaweb2/support/2.9/public/css/icinga/legacy-theme.less \ && curl -o select-icon-legacy.svg https://raw.githubusercontent.com/Icinga/icingaweb2/support/2.9/public/img/select-icon-legacy.svg \ && git clone https://github.com/Icinga/icingadb-web.git icingadb

FROM icinga/icingaweb2:master USER root

RUN apt upgrade -y RUN apt update -y RUN apt-get install software-properties-common -y

RUN add-apt-repository ppa:ondrej/php -y

RUN apt update -y RUN apt install -y \ php php-common RUN apt update -y RUN php --version RUN apt install -y composer RUN composer require -d /usr/share/icinga-php/ipl ipl/html:dev-master --ignore-platform-reqs --with-all-dependencies RUN composer require -d /usr/share/icinga-php/ipl ipl/orm:dev-master --ignore-platform-reqs --with-all-dependencies RUN composer require -d /usr/share/icinga-php/ipl ipl/sql:dev-master --ignore-platform-reqs --with-all-dependencies RUN composer require -d /usr/share/icinga-php/ipl ipl/validator:dev-master --ignore-platform-reqs --with-all-dependencies RUN composer update -d /usr/share/icinga-php/ipl --ignore-platform-reqs --with-all-dependencies RUN composer require -d /usr/share/icinga-php/ipl ipl/web:dev-master --ignore-platform-reqs --with-all-dependencies RUN composer require -d /usr/share/icinga-php/ipl ipl/stdlib:dev-master --ignore-platform-reqs --with-all-dependencies

RUN rm -rf /usr/share/icingaweb2/modules/icingadb/* USER www-data COPY --from=0 /icingadb /usr/share/icingaweb2/modules/icingadb COPY --from=0 /Legacy.less /usr/share/icingaweb2/public/css/themes/Legacy.less COPY --from=0 /select-icon-legacy.svg /usr/share/icingaweb2/public/img/select-icon-legacy.svg

kenroyandfamily commented 2 years ago

shaydanielpro solution works for me, but with a minor tweak:

Better to not execute commands on separate RUN lines since that will increase the size of the image/container:

FROM alpine/git
WORKDIR /
RUN apk --no-cache add curl \
        && curl -o Legacy.less https://raw.githubusercontent.com/Icinga/icingaweb2/support/2.9/public/css/icinga/legacy-theme.less \
        && curl -o select-icon-legacy.svg https://raw.githubusercontent.com/Icinga/icingaweb2/support/2.9/public/img/select-icon-legacy.svg \
        && git clone https://github.com/Icinga/icingadb-web.git icingadb

FROM icinga/icingaweb2:master
USER root

RUN apt upgrade -y \
    && apt update -y \
    && apt-get install software-properties-common -y \
    && apt install -y composer \
    && composer require -d /usr/share/icinga-php/ipl ipl/html:dev-master --ignore-platform-reqs --with-all-dependencies \
    && composer require -d /usr/share/icinga-php/ipl ipl/orm:dev-master --ignore-platform-reqs --with-all-dependencies \
    && composer require -d /usr/share/icinga-php/ipl ipl/sql:dev-master --ignore-platform-reqs --with-all-dependencies \
    && composer require -d /usr/share/icinga-php/ipl ipl/validator:dev-master --ignore-platform-reqs --with-all-dependencies \
    && composer update -d /usr/share/icinga-php/ipl --ignore-platform-reqs --with-all-dependencies \
    && composer require -d /usr/share/icinga-php/ipl ipl/web:dev-master --ignore-platform-reqs --with-all-dependencies \
    && composer require -d /usr/share/icinga-php/ipl ipl/stdlib:dev-master --ignore-platform-reqs --with-all-dependencies

RUN rm -rf /usr/share/icingaweb2/modules/icingadb/*
USER www-data
COPY --from=0 /icingadb /usr/share/icingaweb2/modules/icingadb
COPY --from=0 /Legacy.less /usr/share/icingaweb2/public/css/themes/Legacy.less
COPY --from=0 /select-icon-legacy.svg /usr/share/icingaweb2/public/img/select-icon-legacy.svg
lippserd commented 2 years ago

Hi,

Thanks for the report. I just fixed the issue.

All the best, Eric