php - Docker & Laravel:配置:错误:未满足包要求(oniguruma)
问题描述
谁能帮我解决这个问题。
当我尝试从 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 .
解决方案
@kalatabe 说的是正确的。但如果您绝对想确保安装 mbstring,您也可以添加libonig-dev
到您的apt-get install
推荐阅读
- javascript - 刷新页面时设置文本框值并提交表单
- java - Getting HttpException on 302 redirect in my response
- excel - Excel macro for replace points with commas
- typescript - 为什么使用 Array.isArray(obj) 检查 Object 可以为空?
- javascript - javascript window.open should open some urls in internet explorer
- python - Django 异常类型:服务器上的 SMTPAuthenticationError
- mysql - 如果我们在列中插入“NOW()”,sql 表的列的数据类型应该是什么
- c# - EF Core SqlException: Cannot insert explicit value for identity column in table 'MenuCategories' when IDENTITY_INSERT is set to OFF
- android - Xamarin 表单:TwoWay 绑定和 StringFormat 的问题
- powershell - File not attaching to email in powershell script