G
G
gitdev2020-12-22 12:00:26
PHP
gitdev, 2020-12-22 12:00:26

How to resolve required by: world[libpq-dev]?

Error :

ERROR: unsatisfiable constraints:
  libpq-dev (missing):
    required by: world[libpq-dev]
ERROR: Service 'refer-php' failed to build: The command '/bin/sh -c apk update && apk upgrade     && apk add --no-cache --virtual .build-deps ${PHPIZE_DEPS} ${BUILD_DEPENDENSIES}     && apk add --no-cache ${DEPENDENSIES}     && docker-php-ext-install ${EXTENSIONS}     && apk del .build-deps     && rm -rf /tmp/*     && rm -rf /var/cache/apk/*' returned a non-zero code: 1


Dockerfile
FROM php:7.4-fpm-alpine

# Set ENVIRONMENT="production" for production
ARG ENVIRONMENT="development"

ENV DEPENDENSIES="git curl openssh-client icu-dev libxml2-dev libxslt-dev libzip-dev espeak libpq-dev"
ENV BUILD_DEPENDENSIES="g++ make autoconf"
ENV EXTENSIONS="soap intl zip xsl bcmath sockets libpq libpq-dev pdo pdo_pgsql pgsql"
ENV COMPOSER_VERSION="1.8.0"

RUN apk update && apk upgrade \
    && apk add --no-cache --virtual .build-deps ${PHPIZE_DEPS} ${BUILD_DEPENDENSIES} \
    && apk add --no-cache ${DEPENDENSIES} \
    && docker-php-ext-install ${EXTENSIONS} \
    #&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
    && apk del .build-deps \
    && rm -rf /tmp/* \
    && rm -rf /var/cache/apk/*

#RUN docker-php-ext-configure pgsql \
#    && docker-php-ext-install pgsql pdo_pgsql

# INSTALL composer
RUN mkdir /etc/composer \
    && wget https://getcomposer.org/installer -P /etc/composer \
    && cd /etc/composer && php ./installer  --filename=composer --verion=${COMPOSER_VERSION} --install-dir=/bin \
    && rm /etc/composer/installer \
    && chmod a+x /bin/composer

# INSTALL xdebug
RUN if [ "$ENVIRONMENT" == "development" ]; then \
    pecl channel-update pecl.php.net \
    && apk add --no-cache --virtual .build-deps ${PHPIZE_DEPS} ${BUILD_DEPENDENSIES} \
    && apk add --no-cache ${DEPENDENSIES} \
    && pecl install xdebug-3.0.1 \
    && docker-php-ext-enable xdebug \
    && echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.client_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.remote_handler=dbgp" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.discover_client_host=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.idekey=PHPSTORM" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && rm -rf /tmp/* \
    ;fi

COPY init-php.sh /init.sh

ENTRYPOINT ["/init.sh"]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question