A
A
Arris2018-11-27 16:05:12
Docker
Arris, 2018-11-27 16:05:12

Docker: the requested PHP extension bcmath is missing from your system. How to fix?

dockerfile:

FROM ubuntu:xenial

ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8

RUN apt-get -yqq update && \
    apt-get -yqq install ca-certificates gcc make nano dialog libjpeg-dev libpng-dev libfreetype6-dev

RUN echo "Europe/Moscow" > /etc/timezone

RUN apt-get -y install software-properties-common
RUN add-apt-repository ppa:ondrej/php

RUN apt-get update -yqq && \
    apt-get install -yqq \
        php7.2 \
        php7.2-common php7.2-mysql php7.2-mbstring php7.2-soap php7.2-cli php7.2-intl php7.2-json php7.2-xsl php7.2-xml \
        php7.2-imap php7.2-ldap php7.2-curl php7.2-gd php7.2-dev php7.2-fpm php7.2-bcmath php7.2-zip && \
  apt-get install pkg-config && \
    apt-get install -yq --no-install-recommends && \
    apt-get install -yqq composer

RUN echo "date.timezone=Europe/Moscow" > /etc/php/7.2/cli/conf.d/timezone.ini

COPY php-conf/fpm.conf      /etc/php/7.2/fpm/php-fpm.conf
COPY php-conf/www.conf      /etc/php/7.2/fpm/pool.d/www.conf

RUN usermod -aG www-data www-data
RUN  dpkg-reconfigure -f noninteractive tzdata

COPY start.sh /start.sh
RUN chmod +x /start.sh

CMD ["/start.sh"]

WORKDIR /var/www/

EXPOSE 9000

Build to image `arris_php`
docker-compose.yaml
version: '3.3'
networks:
  tabun_network:
    driver: bridge
services:
  php:
    container_name: tabun_php
    image: arris_php
    restart: always
    networks:
      - tabun_network
    volumes:
      - "./www:/var/www/html"
      - "./log/php/:/var/log/php/"

  composer:
    container_name: tabun_composer
    image: "composer"
    networks:
      - tabun_network
    volumes:
      - "./www:/app"
    command: install

Result:
Problem 1
    - Installation request for smarty-gettext/smarty-gettext 1.4.0 -> satisfiable by smarty-gettext/smarty-gettext[1.4.0].
    - smarty-gettext/smarty-gettext 1.4.0 requires ext-gettext * -> the requested PHP extension gettext is missing from your system.
  Problem 2
    - php-amqplib/php-amqplib v2.8.1 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - php-amqplib/php-amqplib v2.8.0 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - Installation request for php-amqplib/php-amqplib ^2.8 -> satisfiable by php-amqplib/php-amqplib[v2.8.0, v2.8.1].

Where to dig?
No, installing the extension via docker-ext-install does not help .
PS I note that outside the docker container, on the same set of packages, the composer works normally. In addition, the composer works normally, if in interactive mode you put the file with handles inside the container from inside the container, then run composer install.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2018-11-27
@Arris

Perhaps the recommendations from the Suggestions->PHP Extensions section will apply? https://hub.docker.com/_/composer/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question