環境
windows11
Docker version 20.10.16
DockerでPHP8の環境を構築しようとして失敗する
DockerでPHP8の開発環境を用意するために、DockerFile内でremiファイルをインストールしてからPHPをインストールする流れにしたかったのですが、remiのインストールにどうしても失敗してしまいます。
windows10のPCから今回のPCに買い替えて、同じ設定ファイルで”docker-compose up -d --build”したのですが、初めて見るエラーで調べても解決しませんでした。
エラー内容
GitBash
1#27 [docker-apache stage-0 11/31] RUN dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm 2#27 3.647 Extra Packages for Enterprise Linux 8 - x86_64 3.6 MB/s | 11 MB 00:03 3#27 6.645 Extra Packages for Enterprise Linux Modular 8 - 1.2 MB/s | 1.0 MB 00:00 4#27 6.867 Last metadata expiration check: 0:00:01 ago on 2022年06月08日 17時21分33秒. 5#27 8.506 remi-release-8.rpm 32 kB/s | 29 kB 00:00 6#27 8.541 Error: 7#27 8.541 Problem: conflicting requests 8#27 8.541 - nothing provides redhat-release >= 8.6 needed by remi-release-8.6-1.el8.remi.noarch 9#27 8.541 (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages) 10#27 ERROR: executor failed running [/bin/sh -c dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm]: exit code: 1 11------ 12 > [docker-apache stage-0 11/31] RUN dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm: 13#27 3.647 Extra Packages for Enterprise Linux 8 - x86_64 3.6 MB/s | 11 MB 00:03 14#27 6.645 Extra Packages for Enterprise Linux Modular 8 - 1.2 MB/s | 1.0 MB 00:00 15#27 6.867 Last metadata expiration check: 0:00:01 ago on 2022年06月08日 17時21分33秒. 16#27 8.506 remi-release-8.rpm 32 kB/s | 29 kB 00:00 17#27 8.541 Error: 18#27 8.541 Problem: conflicting requests 19#27 8.541 - nothing provides redhat-release >= 8.6 needed by remi-release-8.6-1.el8.remi.noarch 20#27 8.541 (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages) 21------ 22failed to solve: executor failed running [/bin/sh -c dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm]: exit code: 1
Dockerfile
1FROM centos:8 2 3# CentOS更新 4RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* &&\ 5 sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-* 6RUN dnf clean all 7RUN dnf -y update 8RUN dnf -y upgrade 9RUN dnf -y install dnf-utils 10 11RUN dnf -y install glibc-locale-source glibc-langpack-en 12RUN localedef -f UTF-8 -i ja_JP ja_JP.UTF-8 13ENV LANG="ja_JP.UTF-8" \ 14 LANGUAGE="ja_JP:ja" \ 15 LC_ALL="ja_JP.UTF-8" 16 17# タイムゾーンをJSTに合わせる 18RUN ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime 19 20# <今回エラーになっている箇所> 21# PHPリポジトリを有効化 22RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm 23RUN dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm 24RUN dnf module enable php:remi-8.0 -y 25# PHP追加モジュールをインストール 26RUN dnf -y install php 27RUN dnf -y install php-mbstring 28RUN dnf -y install php-zip 29RUN dnf -y install php-gd 30RUN dnf -y install php-xml 31RUN dnf -y install php-opcache 32RUN dnf -y install php-fpm 33# MySQL/MariaDBインストール 34RUN dnf -y install php-mysqli 35RUN dnf -y install php-mysqlnd 36# PostgreSQLインストール 37RUN dnf install -y php-pgsql 38RUN dnf install -y php-pdo 39RUN dnf install -y unzip 40 41# php-fpm 42COPY php-fpm.d/www.conf /etc/php-fpm.d/www.conf 43RUN mkdir -p /var/run/php-fpm 44COPY --from=composer:2.1.6 /usr/bin/composer /usr/bin/composer 45COPY php.ini /etc/php.d/50-docker.ini 46 47# Apacheを入れる 48RUN dnf install -y httpd 49RUN apachectl -v 50RUN systemctl enable httpd.service 51# RUN apachectl start 52 53EXPOSE 80 54 55ENV APACHE_DOCUMENT_ROOT /path/to/new/root 56 57CMD ["/usr/sbin/httpd", "-DFOREGROUND"]
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/06/10 05:05 編集