Error when installing the package using Docker, what's the problem and how to solve?

Step 3/9 : RUN docker-php-ext-install mbstring


checking whether to enable multibyte string support... yes, shared
checking whether to enable multibyte regex support (requires oniguruma)... yes
checking for oniguruma... no
configure: error: Package requirements (oniguruma) were not met:

No package 'oniguruma' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ONIG_CFLAGS
and ONIG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
ERROR: Service 'php-fpm' failed to build: The command '/bin/sh -c docker-php-ext-install mbstring' returned a non-zero code: 1

FROM php:7.4-fpm

RUN apt-get update \
 && apt-get install -y libpq-dev \
 && pecl install mongodb \
 && docker-php-ext-enable mongodb
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install exif
RUN docker-php-ext-install opcache

RUN docker-php-ext-configure pgsql -- with-pgsql=/usr/local/pgsql \
 && docker-php-ext-install pgsql pdo_pgsql
COPY conf/ /usr/local/etc/php-fpm.d/
CMD ["php-fpm"]

WORKDIR "/project"
April 4th 20 at 00:54
2 answers
April 4th 20 at 00:56
Removed mcript
April 4th 20 at 00:58
Try to put libonig-dev , it seems to fix
RUN apt-get update \
 && apt-get install -y libonig-dev libpq-dev \


Find more questions by tags Docker