谁能帮我解决这个问题。
当我尝试从 dockerfile 为 laravel 应用程序创建 docker 映像时,出现此错误:
检查oniguruma …没有配置:错误:不满足包要求(oniguruma):
> 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. > > ``` > > 命令 '/bin/sh -c docker-php-ext-install pdo mbstring' 返回一个非零代码:1 这是我的 Dockerfile:
FROM php:7 RUN apt-get update -y && apt-get install -y openssl zip unzip git RUN curl -sS https://getcomposer.org/installer | php – –install-dir=/usr/local/bin –filename=composer RUN docker-php-ext-install pdo mbstring WORKDIR /app COPY app /app # this copies all the app files to a folder called
app
RUN composer install
CMD php artisan serve –host=0.0.0.0 –port=8000 EXPOSE 8000
以及构建 Dockerfile 的 docker 命令
sudo docker build -t test .
”`
原文由 Amy Murphy 发布,翻译遵循 CC BY-SA 4.0 许可协议
只需从
docker-php-ext-install
指令中删除mbstring
即可。该错误是由依赖问题引起的 -
mbstring
扩展需要oniguruma
库才能使多字节正则表达式函数工作。从 安装指南:但是,在您使用的映像中,扩展程序已经安装和配置,因此您无需执行任何其他操作: