【问题标题】:"Unable to find a match Error" while trying to build a Docker image with docker-compose尝试使用 docker-compose 构建 Docker 映像时出现“无法找到匹配错误”
【发布时间】:2019-12-06 23:17:31
【问题描述】:

我正在尝试构建一个包含 Nginx Web 服务器和 PHP 的 docker 映像。

我正在使用带有 centos 7 的虚拟机

这是我的 Dockerfile

FROM remote-host

COPY ./conf/nginx.repo /etc/yum.repos.d/nginx.repo

RUN yum -y update && \
    yum install -y epel-release && \
    yum -y install nginx openssl --enablerepo=nginx && \
    yum -y update &&  \
    yum -y install https://centos7.iuscommunity.org/ius-release.rpm --nobest --skip-broken && \
    yum -y install php71u-fpm php71u-cli && \
    yum clean all

EXPOSE 80 443

VOLUME /var/www/html /var/log/nginx /var/log/php-fpm /var/lib/php-fpm

COPY ./conf/nginx.conf /etc/nginx/conf.d/default.conf

COPY ./bin/start.sh /start.sh

RUN chmod +x /start.sh

CMD /start.sh

这是错误输出:

Problem: conflicting requests
  - nothing provides epel-release = 7 needed by ius-release-2-1.el7.ius.noarch
================================================================================
Skip  1 Package

Nothing to do.
Complete!
Last metadata expiration check: 0:00:22 ago on Fri Dec  6 23:07:40 2019.
**No match for argument: php71u-fpm
No match for argument: php71u-cli
Error: Unable to find a match**
ERROR: Service 'web' failed to build: The command '/bin/sh -c yum -y update &&     yum install -y epel-release &&     yum -y install nginx openssl --enablerepo=nginx &&     yum -y update &&      yum -y install https://centos7.iuscommunity.org/ius-release.rpm --nobest --skip-broken &&     yum -y install php71u-fpm php71u-cli &&     yum clean all' returned a non-zero code: 1

【问题讨论】:

  • 你可以试试这个 yum --enablerepo=extras install -y epel-release
  • 不幸的是没有帮助
  • 我也有同样的问题。有什么想法吗?

标签: docker docker-compose centos7


【解决方案1】:

看起来epel-release 包丢失了。

确保CentOS Extras 存储库包含一个用于安装 EPEL 的包

您可以使用以下命令进行检查

yum search epel-release
yum info epel-release

【讨论】:

  • 是的,我一开始就有这个问题..但后来我添加了 yum install -y epel-release && \ 6 我的 Dockerfile 行 - 仍然是同样的问题。请注意,当我在主机上运行 yum -y install php71u-fpm php71u-cli 时它可以工作,但在构建 docker 映像时却不行
【解决方案2】:

软件包系列 php71u is deprecated 但可以通过将 repo 设置为“ius-archive”而不是“ius-release”来下载。同样明智:

yum --enablerepo=ius-archive install php71u-fpm

【讨论】:

    猜你喜欢
    • 2020-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-15
    • 2015-11-02
    相关资源
    最近更新 更多